aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-04-24 20:54:38 +0000
committerDouglas Gregor <dgregor@apple.com>2010-04-24 20:54:38 +0000
commitd1a272204cef9304df3930d94f66713b05db27d6 (patch)
tree725d0db5d5a84300d024524d465bef8a68cd7ee5 /test
parent564618f782b9f6d373f789d8cf24943fd345904d (diff)
When we are performing copy initialization of a class type via its
copy constructor, suppress user-defined conversions on the argument. Otherwise, we can end up in a recursion loop where the bind the argument of the copy constructor to another copy constructor call, whose argument is then a copy constructor call... Found by Boost.Regex which, alas, still isn't building. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102269 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/SemaCXX/conditional-expr.cpp3
-rw-r--r--test/SemaCXX/conversion-function.cpp15
-rw-r--r--test/SemaCXX/overload-call.cpp2
3 files changed, 16 insertions, 4 deletions
diff --git a/test/SemaCXX/conditional-expr.cpp b/test/SemaCXX/conditional-expr.cpp
index aa41323239..a812a5920d 100644
--- a/test/SemaCXX/conditional-expr.cpp
+++ b/test/SemaCXX/conditional-expr.cpp
@@ -7,8 +7,7 @@
struct ToBool { explicit operator bool(); };
struct B;
-struct A { A(); A(const B&); }; // expected-note 2 {{candidate constructor}} \
- // expected-note 2 {{candidate is the implicit copy constructor}}
+struct A { A(); A(const B&); }; // expected-note 2 {{candidate constructor}}
struct B { operator A() const; }; // expected-note 2 {{candidate function}}
struct I { operator int(); };
struct J { operator I(); };
diff --git a/test/SemaCXX/conversion-function.cpp b/test/SemaCXX/conversion-function.cpp
index dfc0650641..3e96d02495 100644
--- a/test/SemaCXX/conversion-function.cpp
+++ b/test/SemaCXX/conversion-function.cpp
@@ -56,7 +56,7 @@ public:
// This used to crash Clang.
struct Flip;
-struct Flop { // expected-note{{candidate is the implicit copy constructor}}
+struct Flop {
Flop();
Flop(const Flip&); // expected-note{{candidate constructor}}
};
@@ -202,3 +202,16 @@ namespace smart_ptr {
return X(Y());
}
}
+
+struct Any {
+ Any(...);
+};
+
+struct Other {
+ Other(const Other &);
+ Other();
+};
+
+void test_any() {
+ Any any = Other(); // expected-error{{cannot pass object of non-POD type 'Other' through variadic constructor; call will abort at runtime}}
+}
diff --git a/test/SemaCXX/overload-call.cpp b/test/SemaCXX/overload-call.cpp
index feec9df6b7..79c74cec49 100644
--- a/test/SemaCXX/overload-call.cpp
+++ b/test/SemaCXX/overload-call.cpp
@@ -408,7 +408,7 @@ namespace PR6483 {
}
namespace PR6078 {
- struct A { // expected-note{{candidate is the implicit copy constructor}}
+ struct A {
A(short); // expected-note{{candidate constructor}}
A(long); // expected-note{{candidate constructor}}
};