diff options
Diffstat (limited to 'test/CXX/temp/temp.arg/temp.arg.nontype/p1.cpp')
-rw-r--r-- | test/CXX/temp/temp.arg/temp.arg.nontype/p1.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/CXX/temp/temp.arg/temp.arg.nontype/p1.cpp b/test/CXX/temp/temp.arg/temp.arg.nontype/p1.cpp index 3f70ca7c81ab..22ea018842d4 100644 --- a/test/CXX/temp/temp.arg/temp.arg.nontype/p1.cpp +++ b/test/CXX/temp/temp.arg/temp.arg.nontype/p1.cpp @@ -1,4 +1,5 @@ // RUN: %clang_cc1 -fsyntax-only -verify -triple=x86_64-linux-gnu %s +// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify -triple=x86_64-linux-gnu %s -DCPP11ONLY // C++11 [temp.arg.nontype]p1: // @@ -6,6 +7,8 @@ // be one of: // -- an integral constant expression; or // -- the name of a non-type template-parameter ; or +#ifndef CPP11ONLY + namespace non_type_tmpl_param { template <int N> struct X0 { X0(); }; template <int N> X0<N>::X0() { } @@ -95,3 +98,14 @@ namespace bad_args { int* iptr = &i; X0<iptr> x0b; // expected-error{{non-type template argument for template parameter of pointer type 'int *' must have its address taken}} } +#endif // CPP11ONLY + +namespace default_args { +#ifdef CPP11ONLY +namespace lambdas { +template<int I = ([] { return 5; }())> //expected-error 2{{constant expression}} expected-note{{constant expression}} +int f(); +} +#endif // CPP11ONLY + +}
\ No newline at end of file |