summaryrefslogtreecommitdiffstats
path: root/test/Frontend/plugin-delayed-template.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/Frontend/plugin-delayed-template.cpp')
-rw-r--r--test/Frontend/plugin-delayed-template.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/Frontend/plugin-delayed-template.cpp b/test/Frontend/plugin-delayed-template.cpp
new file mode 100644
index 0000000..c57ec30
--- /dev/null
+++ b/test/Frontend/plugin-delayed-template.cpp
@@ -0,0 +1,17 @@
+// RUN: %clang_cc1 -fdelayed-template-parsing -load %llvmshlibdir/PrintFunctionNames%pluginext -plugin print-fns -plugin-arg-print-fns -parse-template -plugin-arg-print-fns ForcedTemplate %s 2>&1 | FileCheck %s
+// REQUIRES: plugins, examples
+
+template <typename T>
+void TemplateDep();
+
+// CHECK: top-level-decl: "ForcedTemplate"
+// The plugin should force parsing of this template, even though it's
+// not used and -fdelayed-template-parsing is specified.
+// CHECK: warning: expression result unused
+// CHECK: late-parsed-decl: "ForcedTemplate"
+template <typename T>
+void ForcedTemplate() {
+ TemplateDep<T>(); // Shouldn't crash.
+
+ ""; // Triggers the warning checked for above.
+}
OpenPOWER on IntegriCloud