Files
clang-p2996/clang/test/CXX/basic/basic.namespace/basic.namespace.general/Inputs/p2.h
Chuanqi Xu 60f826663d [C++20] [Modules] Namespace Declaration shouldn't have module linkage
According to [basic.namespace.general]/p2, a namespace declaration
shouldn't have a module linkage.
> A namespace is never attached to a named module and never has a name
> with module linkage.

Without this patch, the compiler would crash for the test in assertion
enabled build due to inconsistent linkage for redeclaration for
namespaces.

Reviewed by: rsmith

Differential Revision: https://reviews.llvm.org/D115132
2021-12-08 13:54:04 +08:00

8 lines
86 B
C++

#ifndef P2_H
#define P2_H
namespace foo {
namespace bar {
}
} // namespace foo
#endif