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 | b4051e7047a0085f0679257386ff183aed3e5162 (patch) | |
tree | 86be0a99d548864e167603673e692a5a38dfa50a /test/SemaCXX | |
parent | 465a8998bd5e2565ed98e1179876ef9266581f74 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154053 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX')
-rw-r--r-- | test/SemaCXX/cxx98-compat.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/SemaCXX/cxx98-compat.cpp b/test/SemaCXX/cxx98-compat.cpp index 70cac8d54e..47589135c9 100644 --- a/test/SemaCXX/cxx98-compat.cpp +++ b/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}} +} |