blob: 672da2725470bcc0637cde8592baadd4f21d1b2a [file] [log] [blame]
Reid Klecknere8bcd4c2013-09-10 22:21:37 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
2
3// Split from function-template-specialization.cpp because the noreturn warning
4// requires analysis-based warnings, which the other errors in that test case
5// disable.
6
7template <int N> void __attribute__((noreturn)) f3() { __builtin_unreachable(); }
8template <> void f3<1>() { } // expected-warning {{function declared 'noreturn' should not return}}
Stephen Hines0e2c34f2015-03-23 12:09:02 -07009
10#if __cplusplus >= 201103L
11namespace PR21942 {
12template <int>
13struct A {
14 void foo[[noreturn]]();
15};
16
17template <>
18void A<0>::foo() {} // expected-warning{{function declared 'noreturn' should not return}}
19}
20#endif