summaryrefslogtreecommitdiffstats
path: root/test/SemaTemplate/function-template-specialization-noreturn.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaTemplate/function-template-specialization-noreturn.cpp')
-rw-r--r--test/SemaTemplate/function-template-specialization-noreturn.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/SemaTemplate/function-template-specialization-noreturn.cpp b/test/SemaTemplate/function-template-specialization-noreturn.cpp
new file mode 100644
index 0000000..3e1f618
--- /dev/null
+++ b/test/SemaTemplate/function-template-specialization-noreturn.cpp
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+// Split from function-template-specialization.cpp because the noreturn warning
+// requires analysis-based warnings, which the other errors in that test case
+// disable.
+
+template <int N> void __attribute__((noreturn)) f3() { __builtin_unreachable(); }
+template <> void f3<1>() { } // expected-warning {{function declared 'noreturn' should not return}}
OpenPOWER on IntegriCloud