diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-04-04 21:11:30 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-04-04 21:11:30 +0000 |
| commit | 9380e0ea236add5de3a02782e3f4f1b1dc308406 (patch) | |
| tree | fb34a952d3c9780f5227430e17c2a1febc2faa07 /clang/test/SemaCXX/cxx98-compat.cpp | |
| parent | 1170b0885f635ef8566d017221e4986ea69cbeb3 (diff) | |
| download | bcm5719-llvm-9380e0ea236add5de3a02782e3f4f1b1dc308406.tar.gz bcm5719-llvm-9380e0ea236add5de3a02782e3f4f1b1dc308406.zip | |
Implement C++11 [temp.arg.nontype]'s permission to use the address of an object
or function with internal linkage as a non-type template argument.
llvm-svn: 154053
Diffstat (limited to 'clang/test/SemaCXX/cxx98-compat.cpp')
| -rw-r--r-- | clang/test/SemaCXX/cxx98-compat.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/cxx98-compat.cpp b/clang/test/SemaCXX/cxx98-compat.cpp index 70cac8d54ec..47589135c9d 100644 --- a/clang/test/SemaCXX/cxx98-compat.cpp +++ b/clang/test/SemaCXX/cxx98-compat.cpp @@ -291,3 +291,11 @@ namespace LiteralUCNs { const char *s1 = "foo\u0031"; // expected-warning {{specifying character '1' with a universal character name is incompatible with C++98}} const wchar_t *s2 = L"bar\u0085"; // expected-warning {{universal character name referring to a control character is incompatible with C++98}} } + +namespace NonTypeTemplateArgs { + template<typename T, T v> struct S {}; + const int k = 5; // expected-note {{here}} + static void f() {} // expected-note {{here}} + S<const int&, k> s1; // expected-warning {{non-type template argument referring to object 'k' with internal linkage is incompatible with C++98}} + S<void(&)(), f> s2; // expected-warning {{non-type template argument referring to function 'f' with internal linkage is incompatible with C++98}} +} |

