aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-11-13 23:59:09 +0000
committerDouglas Gregor <dgregor@apple.com>2009-11-13 23:59:09 +0000
commitfd47648b5d351ff6d1a3e886e1c3d10712ba4675 (patch)
treee87bd20c38f9553a171e0db9dc008ab8ce4b2f65 /test
parente99cc4504946718e4f288f6ba4652c3c7ffa6996 (diff)
Revert r88718, which does NOT solve the constructor-template-as-copy-constructor issue. Big thanks to John for finding this
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88724 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/SemaCXX/constructor-recovery.cpp7
-rw-r--r--test/SemaCXX/copy-constructor-error.cpp8
-rw-r--r--test/SemaTemplate/constructor-template.cpp20
-rw-r--r--test/SemaTemplate/operator-template.cpp6
4 files changed, 12 insertions, 29 deletions
diff --git a/test/SemaCXX/constructor-recovery.cpp b/test/SemaCXX/constructor-recovery.cpp
index f2f9f43a10..50fdc9622e 100644
--- a/test/SemaCXX/constructor-recovery.cpp
+++ b/test/SemaCXX/constructor-recovery.cpp
@@ -1,9 +1,10 @@
// RUN: clang-cc -fsyntax-only -verify %s
-struct C {
- virtual C() = 0; // expected-error{{constructor cannot be declared 'virtual'}}
+struct C { // expected-note {{candidate function}}
+ virtual C() = 0; // expected-error{{constructor cannot be declared 'virtual'}} \
+ expected-note {{candidate function}}
};
void f() {
- C c;
+ C c; // expected-error {{call to constructor of 'c' is ambiguous}}
}
diff --git a/test/SemaCXX/copy-constructor-error.cpp b/test/SemaCXX/copy-constructor-error.cpp
index c50a1579bb..2e42fcc3b1 100644
--- a/test/SemaCXX/copy-constructor-error.cpp
+++ b/test/SemaCXX/copy-constructor-error.cpp
@@ -1,11 +1,13 @@
// RUN: clang-cc -fsyntax-only -verify %s
-struct S {
- S (S); // expected-error {{copy constructor must pass its first argument by reference}}
+struct S { // expected-note {{candidate function}}
+ S (S); // expected-error {{copy constructor must pass its first argument by reference}} \\
+ // expected-note {{candidate function}}
};
S f();
void g() {
- S a( f() ); // expected-error {{no matching constructor}}
+ S a( f() ); // expected-error {{call to constructor of 'a' is ambiguous}}
}
+
diff --git a/test/SemaTemplate/constructor-template.cpp b/test/SemaTemplate/constructor-template.cpp
index f059766356..79bf7c585e 100644
--- a/test/SemaTemplate/constructor-template.cpp
+++ b/test/SemaTemplate/constructor-template.cpp
@@ -1,4 +1,5 @@
// RUN: clang-cc -fsyntax-only -verify %s
+
struct X0 { // expected-note{{candidate}}
X0(int); // expected-note{{candidate}}
template<typename T> X0(T);
@@ -51,22 +52,3 @@ template<class C> struct A {};
template <> struct A<int>{A(const A<int>&);};
struct B { A<int> x; B(B& a) : x(a.x) {} };
-struct X2 {
- X2();
- X2(X2&);
- template<typename T> X2(T, int = 17);
-};
-
-X2 test(bool Cond, X2 x2) {
- if (Cond)
- return x2; // okay, uses copy constructor
-
- return X2(); // expected-error{{incompatible type}}
-}
-
-struct X3 {
- template<typename T> X3(T);
-};
-
-template<> X3::X3(X3); // expected-error{{no function template matches}}
-
diff --git a/test/SemaTemplate/operator-template.cpp b/test/SemaTemplate/operator-template.cpp
index af01a10042..7039e0ec83 100644
--- a/test/SemaTemplate/operator-template.cpp
+++ b/test/SemaTemplate/operator-template.cpp
@@ -11,8 +11,6 @@ int a0(A<int> x) { return x == 1; }
template<class X>struct B{typedef X Y;};
template<class X>bool operator==(B<X>*,typename B<X>::Y); // \
expected-error{{overloaded 'operator==' must have at least one parameter of class or enumeration type}} \
-expected-note{{in instantiation of function template specialization}}
-int a(B<int> x) {
- return operator==(&x,1); // expected-error{{no matching function}}
-}
+expected-note{{in instantiation of member function}}
+int a(B<int> x) { return operator==(&x,1); }