From 5332411cd7464979fe6ee2e7bf48f87fb8055f96 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Wed, 16 Jul 2014 21:33:43 +0000 Subject: When list-initializing an object of class type, if we pick an initializer list constructor (and pass it an implicitly-generated std::initializer_list object), be sure to mark the resulting construction as list-initialization. This fixes an assert in template instantiation where we previously thought we'd got direct non-list initialization without any parentheses. llvm-svn: 213201 --- .../SemaCXX/cxx0x-initializer-stdinitializerlist.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp') diff --git a/clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp b/clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp index db6614de037..eda4e44b773 100644 --- a/clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp +++ b/clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp @@ -238,3 +238,19 @@ namespace DR1070 { S s[3] = { {1, 2, 3}, {4, 5} }; // ok S *p = new S[3] { {1, 2, 3}, {4, 5} }; // ok } + +namespace ListInitInstantiate { + struct A { + A(std::initializer_list); + }; + struct B : A { + B(int); + }; + template struct X { + X(); + A a; + }; + template X::X() : a{B{0}, B{1}} {} + + X x; +} -- cgit v1.2.3