1 // Based on C++20 10.2 example 1.
5 // RUN: split-file %s %t
7 // RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/std-10-2-ex1-tu1.cpp \
8 // RUN: -pedantic-errors -verify -o %t/m1.pcm
13 //--- std-10-2-ex1-tu1.cpp
16 #include "std-10-2-ex1.h"
17 // expected-error@std-10-2-ex1.h:* {{export declaration can only be used within a module purview}}
20 export
namespace {} // expected-error {{anonymous namespaces cannot be exported}}
21 export
namespace { // expected-error {{anonymous namespaces cannot be exported}}
24 namespace { // expected-note {{anonymous namespace begins here}}
25 export
int a2
; // expected-error {{export declaration appears within anonymous namespace}}
27 export
static int b
; // expected-error {{declaration of 'b' with internal linkage cannot be exported}}
30 export
namespace N
{} // namespace N
31 export
using namespace N
; // No diagnostic after P2615R1 DR