aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/constructor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/constructor.cpp')
-rw-r--r--test/SemaCXX/constructor.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/SemaCXX/constructor.cpp b/test/SemaCXX/constructor.cpp
new file mode 100644
index 0000000000..4f9dd2b79d
--- /dev/null
+++ b/test/SemaCXX/constructor.cpp
@@ -0,0 +1,14 @@
+// RUN: clang -fsyntax-only -verify %s
+
+class Foo {
+ Foo();
+ (Foo)(float) { }
+ explicit Foo(int);
+ Foo(const Foo&);
+
+ 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}}
+
+ int Foo(int, int); // expected-error{{constructor cannot have a return type}}
+};