blob: d45938bb3e674af02e00e14a92fff4fc43c1fd2c [file] [log] [blame]
Richard Trieuf858bd82011-05-26 20:11:09 +00001// RUN: cp %s %t
2// RUN: %clang_cc1 -fsyntax-only -verify %s
3// RUN: not %clang_cc1 -x c++ -fixit %t
4// RUN: %clang_cc1 -x c++ %t
5
6namespace foo1::foo2::foo3 { // expected-error {{nested namespace definition must define each namespace separately}}
7 int foo(int x) { return x; }
8}
9
10int foo(int x) {
11 return foo1::foo2::foo3::foo(x);
12}
13
14namespace bar1 {
15 namespace bar2 {
16 namespace bar3 {
17 int bar(int x) { return x; }
18 }
19 }
20}
21
22int bar(int x) {
23 return bar1::bar2::bar3::bar(x);
24}