diff options
Diffstat (limited to 'test/CXX/except/except.spec/p1.cpp')
-rw-r--r-- | test/CXX/except/except.spec/p1.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/CXX/except/except.spec/p1.cpp b/test/CXX/except/except.spec/p1.cpp index fa53c9f5d23f4..03d75326a6432 100644 --- a/test/CXX/except/except.spec/p1.cpp +++ b/test/CXX/except/except.spec/p1.cpp @@ -86,3 +86,12 @@ namespace PR11084 { f<0>(); // expected-note{{in instantiation of function template specialization}} } } + +namespace FuncTmplNoexceptError { + int a = 0; + // expected-error@+1{{argument to noexcept specifier must be a constant expression}} + template <class T> T f() noexcept(a++){ return {};} + void g(){ + f<int>(); + } +}; |