diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2012-04-14 14:01:31 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2012-04-14 14:01:31 +0000 |
commit | dbe13110f59f48b4dbb7552b3ac2935acdeece7f (patch) | |
tree | be1815eb79b42ff482a8562b13c2dcbf0c5dcbee /test/Parser/cxx-class.cpp | |
parent | 9da628931ebf2609493570f87824ca22402cc65f (diff) | |
download | src-dbe13110f59f48b4dbb7552b3ac2935acdeece7f.tar.gz src-dbe13110f59f48b4dbb7552b3ac2935acdeece7f.zip |
Vendor import of clang trunk r154661:vendor/clang/clang-trunk-r154661
Notes
Notes:
svn path=/vendor/clang/dist/; revision=234287
svn path=/vendor/clang/clang-trunk-r154661/; revision=234288; tag=vendor/clang/clang-trunk-r154661
Diffstat (limited to 'test/Parser/cxx-class.cpp')
-rw-r--r-- | test/Parser/cxx-class.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/Parser/cxx-class.cpp b/test/Parser/cxx-class.cpp index 1c0d862b3096..1b3dd41ee829 100644 --- a/test/Parser/cxx-class.cpp +++ b/test/Parser/cxx-class.cpp @@ -54,6 +54,36 @@ public; // expected-error{{expected ':'}} int i; }; +class F { + int F1 { return 1; } // expected-error{{function definition does not declare parameters}} + void F2 {} // expected-error{{function definition does not declare parameters}} + typedef int F3() { return 0; } // expected-error{{function definition declared 'typedef'}} + typedef void F4() {} // expected-error{{function definition declared 'typedef'}} +}; + +namespace ctor_error { + class Foo {}; + // By [class.qual]p2, this is a constructor declaration. + Foo::Foo (F) = F(); // expected-error{{does not match any declaration in 'ctor_error::Foo'}} + + class Ctor { // expected-note{{not complete until the closing '}'}} + Ctor(f)(int); // ok + Ctor(g(int)); // ok + Ctor(x[5]); // expected-error{{incomplete type}} + + Ctor(UnknownType *); // expected-error{{unknown type name 'UnknownType'}} + void operator+(UnknownType*); // expected-error{{unknown type name 'UnknownType'}} + }; + + Ctor::Ctor (x) = { 0 }; // \ + // expected-error{{qualified reference to 'Ctor' is a constructor name}} + + Ctor::Ctor(UnknownType *) {} // \ + // expected-error{{unknown type name 'UnknownType'}} + void Ctor::operator+(UnknownType*) {} // \ + // expected-error{{unknown type name 'UnknownType'}} +} + // PR11109 must appear at the end of the source file class pr11109r3 { // expected-note{{to match this '{'}} public // expected-error{{expected ':'}} expected-error{{expected '}'}} expected-error{{expected ';' after class}} |