Clang Project

clang_source_code/test/CXX/dcl.dcl/basic.namespace/namespace.def/p7.cpp
1// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
2
3// FIXME: We should probably suppress the warning on reopening an inline
4// namespace without the inline keyword if it's not the first opening of the
5// namespace in the file, because there's no risk of the inlineness differing
6// across TUs in that case.
7
8namespace NIL {} // expected-note {{previous definition}}
9inline namespace NIL {} // expected-error {{cannot be reopened as inline}}
10inline namespace IL {} // expected-note {{previous definition}}
11namespace IL {} // expected-warning{{inline namespace reopened as a non-inline namespace}}
12
13namespace {} // expected-note {{previous definition}}
14inline namespace {} // expected-error {{cannot be reopened as inline}}
15namespace X {
16  inline namespace {} // expected-note {{previous definition}}
17  namespace {} // expected-warning {{inline namespace reopened as a non-inline namespace}}
18}
19