2 // RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++98
3 // RUN: not %clang_cc1 -x c++ -std=c++14 -fixit %t -Werror -DFIXIT
4 // RUN: %clang_cc1 -x c++ -std=c++14 %t -DFIXIT
5 // RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++17 -Wc++14-compat
7 namespace foo1::foo2::foo3
{
8 #if __cplusplus <= 201400L
9 // expected-warning@-2 {{nested namespace definition is a C++17 extension; define each namespace separately}}
11 // expected-warning@-4 {{nested namespace definition is incompatible with C++ standards before C++17}}
13 int foo(int x
) { return x
; }
17 inline namespace goo::bar
{ // expected-error {{nested namespace definition cannot be 'inline'}} expected-warning 0-1{{C++11 feature}}
25 return foo1::foo2::foo3::foo(x
);
31 int bar(int x
) { return x
; }
37 return bar1::bar2::bar3::bar(x
);