diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-11-13 23:14:53 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-11-13 23:14:53 +0000 |
commit | cad84b7c12564ff37feb66d6d004bb609bea8788 (patch) | |
tree | afab19a2565e6069b475747c8b4946490d59d94a /test/SemaCXX | |
parent | 65d0e28583ac050ec9aa71b469285faad48d137e (diff) |
A constructor template cannot be instantiated to a copy
constructor. Make sure that such declarations can never be formed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88718 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX')
-rw-r--r-- | test/SemaCXX/constructor-recovery.cpp | 7 | ||||
-rw-r--r-- | test/SemaCXX/copy-constructor-error.cpp | 8 |
2 files changed, 6 insertions, 9 deletions
diff --git a/test/SemaCXX/constructor-recovery.cpp b/test/SemaCXX/constructor-recovery.cpp index 50fdc9622e..f2f9f43a10 100644 --- a/test/SemaCXX/constructor-recovery.cpp +++ b/test/SemaCXX/constructor-recovery.cpp @@ -1,10 +1,9 @@ // RUN: clang-cc -fsyntax-only -verify %s -struct C { // expected-note {{candidate function}} - virtual C() = 0; // expected-error{{constructor cannot be declared 'virtual'}} \ - expected-note {{candidate function}} +struct C { + virtual C() = 0; // expected-error{{constructor cannot be declared 'virtual'}} }; void f() { - C c; // expected-error {{call to constructor of 'c' is ambiguous}} + C c; } diff --git a/test/SemaCXX/copy-constructor-error.cpp b/test/SemaCXX/copy-constructor-error.cpp index 2e42fcc3b1..c50a1579bb 100644 --- a/test/SemaCXX/copy-constructor-error.cpp +++ b/test/SemaCXX/copy-constructor-error.cpp @@ -1,13 +1,11 @@ // RUN: clang-cc -fsyntax-only -verify %s -struct S { // expected-note {{candidate function}} - S (S); // expected-error {{copy constructor must pass its first argument by reference}} \\ - // expected-note {{candidate function}} +struct S { + S (S); // expected-error {{copy constructor must pass its first argument by reference}} }; S f(); void g() { - S a( f() ); // expected-error {{call to constructor of 'a' is ambiguous}} + S a( f() ); // expected-error {{no matching constructor}} } - |