diff options
author | dim <dim@FreeBSD.org> | 2015-05-27 18:47:56 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-05-27 18:47:56 +0000 |
commit | 3191b2b32a96e1a6ee833fcca73e5c8e0c67ba65 (patch) | |
tree | dbbd4047878da71c1a706e26ce05b4e7791b14cc /test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp | |
parent | 38d6f2e7f2ce51a5b3836d26596c6c34a3288752 (diff) | |
download | FreeBSD-src-3191b2b32a96e1a6ee833fcca73e5c8e0c67ba65.zip FreeBSD-src-3191b2b32a96e1a6ee833fcca73e5c8e0c67ba65.tar.gz |
Vendor import of clang trunk r238337:
https://llvm.org/svn/llvm-project/cfe/trunk@238337
Diffstat (limited to 'test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp')
-rw-r--r-- | test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp b/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp index 2405d2a..a78f022 100644 --- a/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp +++ b/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp @@ -260,3 +260,18 @@ namespace ListInitInstantiate { template<typename T> void g() { int k = f({0}); } template void g<int>(); } + +namespace TemporaryInitListSourceRange_PR22367 { + struct A { + constexpr A() {} + A(std::initializer_list<int>); // expected-note {{here}} + }; + constexpr int f(A) { return 0; } + constexpr int k = f( // expected-error {{must be initialized by a constant expression}} + // The point of this test is to check that the caret points to + // 'std::initializer_list', not to '{0}'. + std::initializer_list // expected-note {{constructor}} + <int> + {0} + ); +} |