From 3191b2b32a96e1a6ee833fcca73e5c8e0c67ba65 Mon Sep 17 00:00:00 2001 From: dim Date: Wed, 27 May 2015 18:47:56 +0000 Subject: Vendor import of clang trunk r238337: https://llvm.org/svn/llvm-project/cfe/trunk@238337 --- test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp') 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 void g() { int k = f({0}); } template void g(); } + +namespace TemporaryInitListSourceRange_PR22367 { + struct A { + constexpr A() {} + A(std::initializer_list); // 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}} + + {0} + ); +} -- cgit v1.1