1 // RUN: %clang_cc1 -std=c++2a %s -DERRORS -verify
2 // RUN: %clang_cc1 -std=c++2a %s -emit-module-interface -o %t.pcm
3 // RUN: %clang_cc1 -std=c++2a %s -fmodule-file=M=%t.pcm -DIMPLEMENTATION -verify -Db=b2 -Dc=c2
8 export
int a
; // expected-error {{export declaration can only be used within a module purview}}
11 #ifndef IMPLEMENTATION
14 // expected-error@#1 {{export declaration can only be used within a module purview}}
15 // expected-error@#2 {{export declaration can only be used within a module purview}}
16 // expected-note@+2 1+{{add 'export'}}
26 namespace { // expected-note 2{{anonymous namespace begins here}}
27 export
int d1
; // expected-error {{export declaration appears within anonymous namespace}}
29 export
int d2
; // expected-error {{export declaration appears within anonymous namespace}}
33 export export
int e
; // expected-error {{within another export declaration}}
34 export
{ export
int f
; } // expected-error {{within another export declaration}} expected-note {{export block begins here}}
36 module
:private; // expected-note {{private module fragment begins here}}
37 export
int priv
; // expected-error {{export declaration cannot be used in a private module fragment}}