blob: c8b5746a39a627f2eb325f72dbe118b7740f28ee [file] [log] [blame]
Shih-wei Liaoea285162010-06-04 12:34:56 -07001// RUN: %clang_cc1 -fsyntax-only -verify %s
2namespace foo {
3 namespace wibble {
4 struct x { int y; };
5
6 namespace bar {
7 namespace wonka {
8 struct x {
9 struct y { };
10 };
11 }
12 }
13 }
14}
15
16namespace bar {
17 typedef int y;
18
19 struct incomplete; // expected-note{{forward declaration of 'bar::incomplete'}}
20}
21void test() {
22 foo::wibble::x a;
23 ::bar::y b;
24 a + b; // expected-error{{invalid operands to binary expression ('foo::wibble::x' and '::bar::y' (aka 'int'))}}
25
26 ::foo::wibble::bar::wonka::x::y c;
27 c + b; // expected-error{{invalid operands to binary expression ('::foo::wibble::bar::wonka::x::y' and '::bar::y' (aka 'int'))}}
28
29 (void)sizeof(bar::incomplete); // expected-error{{invalid application of 'sizeof' to an incomplete type 'bar::incomplete'}}
30}
31
32int ::foo::wibble::bar::wonka::x::y::* ptrmem;
33