aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/constructor.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2008-10-31 20:25:05 +0000
committerDouglas Gregor <dgregor@apple.com>2008-10-31 20:25:05 +0000
commit030ff0cdad79b9e0602e143e0669364d2bad8bd2 (patch)
treedeabd8ecb703514b3dcd55222707d04a4fe3f4ba /test/SemaCXX/constructor.cpp
parent60d62c29d260596454aaf4cb50cbc756ac08875e (diff)
Semantic checking of constructor declarations and classification of default/copy constructors
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58538 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/constructor.cpp')
-rw-r--r--test/SemaCXX/constructor.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/SemaCXX/constructor.cpp b/test/SemaCXX/constructor.cpp
index 4f9dd2b79d..1aedb29c4e 100644
--- a/test/SemaCXX/constructor.cpp
+++ b/test/SemaCXX/constructor.cpp
@@ -1,11 +1,17 @@
// RUN: clang -fsyntax-only -verify %s
+typedef int INT;
+
class Foo {
Foo();
(Foo)(float) { }
- explicit Foo(int);
+ explicit Foo(int); // expected-error{{previous declaration is here}}
Foo(const Foo&);
+ ((Foo))(INT); // expected-error{{cannot be redeclared}}
+
+ Foo(Foo foo, int i = 17, int j = 42); // expected-error {{copy constructor must pass its first argument by reference}}
+
static Foo(short, short); // expected-error{{constructor cannot be declared 'static'}}
virtual Foo(double); // expected-error{{constructor cannot be declared 'virtual'}}
Foo(long) const; // expected-error{{'const' qualifier is not allowed on a constructor}}