Anders Carlsson | 2cf738f | 2009-08-26 19:22:42 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -fsyntax-only -verify %s |
| 2 | struct A {}; |
| 3 | |
| 4 | enum Foo { F }; |
| 5 | typedef Foo Bar; |
| 6 | |
Douglas Gregor | a71d819 | 2009-09-04 17:36:40 +0000 | [diff] [blame^] | 7 | typedef int Integer; |
| 8 | |
| 9 | void g(); |
| 10 | |
| 11 | namespace N { |
| 12 | typedef Foo Wibble; |
| 13 | } |
| 14 | |
| 15 | void f(A* a, Foo *f, int *i) { |
Anders Carlsson | 2cf738f | 2009-08-26 19:22:42 +0000 | [diff] [blame] | 16 | a->~A(); |
| 17 | a->A::~A(); |
| 18 | |
| 19 | a->~foo(); // expected-error{{identifier 'foo' in pseudo-destructor expression does not name a type}} |
Douglas Gregor | a71d819 | 2009-09-04 17:36:40 +0000 | [diff] [blame^] | 20 | |
| 21 | // FIXME: the type printed below isn't wonderful |
| 22 | a->~Bar(); // expected-error{{no member named}} |
| 23 | |
| 24 | f->~Bar(); |
| 25 | f->~Foo(); |
| 26 | i->~Bar(); // expected-error{{does not match}} |
| 27 | |
| 28 | g().~Bar(); // expected-error{{non-scalar}} |
| 29 | |
| 30 | f->::~Bar(); |
| 31 | f->N::~Wibble(); |
| 32 | |
| 33 | f->::~Bar(17, 42); // expected-error{{cannot have any arguments}} |
Anders Carlsson | 2cf738f | 2009-08-26 19:22:42 +0000 | [diff] [blame] | 34 | } |