1 // The intention of this file to check we could only export declarations in namesapce scope.
3 // RUN: %clang_cc1 -std=c++20 %s -verify
7 export
template <typename T
>
17 export
template <typename T
> struct X
<T
>::iterator
; // expected-error {{cannot export 'iterator' as it is not at namespace scope}}
18 export
template <typename T
> void X
<T
>::foo(); // expected-error {{cannot export 'foo' as it is not at namespace scope}}
19 export
template <typename T
> template <typename U
> U X
<T
>::bar(); // expected-error {{cannot export 'bar' as it is not at namespace scope}}
30 export
struct Y::iterator
; // expected-error {{cannot export 'iterator' as it is not at namespace scope}}
31 export
void Y::foo(); // expected-error {{cannot export 'foo' as it is not at namespace scope}}
32 export
template <typename U
> U
Y::bar(); // expected-error {{cannot export 'bar' as it is not at namespace scope}}
35 template <typename T
> struct X
<T
>::iterator
; // expected-error {{cannot export 'iterator' as it is not at namespace scope}}
36 struct Y::iterator
; // expected-error {{cannot export 'iterator' as it is not at namespace scope}}