From 04fe1bf52e7f802681b93630f4b265b4e6642dcc Mon Sep 17 00:00:00 2001 From: Sebastian Redl Date: Thu, 8 Mar 2012 21:05:45 +0000 Subject: Turn explicit construction of temporaries using initializer list syntax into CXXTemporaryObjectExprs, not just CXXConstructExprs, which have a worrying tendency to vanish. Fixes PR12167. llvm-svn: 152340 --- clang/test/SemaCXX/cxx0x-initializer-constructor.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'clang/test/SemaCXX/cxx0x-initializer-constructor.cpp') diff --git a/clang/test/SemaCXX/cxx0x-initializer-constructor.cpp b/clang/test/SemaCXX/cxx0x-initializer-constructor.cpp index 14420d94dd9..fdc882e049e 100644 --- a/clang/test/SemaCXX/cxx0x-initializer-constructor.cpp +++ b/clang/test/SemaCXX/cxx0x-initializer-constructor.cpp @@ -218,3 +218,21 @@ namespace PR12117 { struct B { B(A); } b{{0}}; struct C { C(int); } c{0}; } + +namespace PR12167 { + template struct string {}; + + struct X { + X(const char v); + template bool operator()(T) const; + }; + + template bool g(const string& s, Comparator cmp) { + return cmp(s); + } + template bool f(const string &s) { + return g(s, X{'x'}); + } + + bool s = f(string<1>()); +} -- cgit v1.2.3