aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/cxx0x-initializer-constructor.cpp
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2012-03-08 21:05:45 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2012-03-08 21:05:45 +0000
commit188158db29f50443b6e412f2a40c800b2669c957 (patch)
tree8cc11757d9f1fcd124ed0a1d1f3918346f587d7a /test/SemaCXX/cxx0x-initializer-constructor.cpp
parent56757e9eaff77fb106662fa88793af866a6267d0 (diff)
Turn explicit construction of temporaries using initializer list syntax into CXXTemporaryObjectExprs, not just CXXConstructExprs, which have a worrying tendency to vanish. Fixes PR12167.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152340 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/cxx0x-initializer-constructor.cpp')
-rw-r--r--test/SemaCXX/cxx0x-initializer-constructor.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/SemaCXX/cxx0x-initializer-constructor.cpp b/test/SemaCXX/cxx0x-initializer-constructor.cpp
index 14420d94dd..fdc882e049 100644
--- a/test/SemaCXX/cxx0x-initializer-constructor.cpp
+++ b/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<int N> struct string {};
+
+ struct X {
+ X(const char v);
+ template<typename T> bool operator()(T) const;
+ };
+
+ template<int N, class Comparator> bool g(const string<N>& s, Comparator cmp) {
+ return cmp(s);
+ }
+ template<int N> bool f(const string<N> &s) {
+ return g(s, X{'x'});
+ }
+
+ bool s = f(string<1>());
+}