2012-03-18 07:06:31 +08:00
// RUN: %clang_cc1 -fsyntax-only -verify %s
namespace PR8019 {
struct x ;
template < typename T > struct x2 ;
struct y {
struct PR8019 : : x { int x ; } ; // expected-error{{non-friend class member 'x' cannot have a qualified name}}
struct inner ;
2012-09-14 04:16:20 +08:00
struct y : : inner { } ; // expected-error{{extra qualification on member 'inner'}}
2012-03-18 07:06:31 +08:00
template < typename T >
struct PR8019 : : x2 { } ; // expected-error{{non-friend class member 'x2' cannot have a qualified name}}
template < typename T >
struct inner_template ;
template < typename T >
2012-09-14 04:16:20 +08:00
struct y : : inner_template { } ; // expected-error{{extra qualification on member 'inner_template'}}
2012-03-18 07:06:31 +08:00
} ;
}
2012-03-29 00:01:27 +08:00
namespace NS {
void foo ( ) ;
extern int bar ;
struct X ;
template < typename T > struct Y ;
template < typename T > void wibble ( T ) ;
2014-12-30 07:12:23 +08:00
struct Z ;
2012-03-29 00:01:27 +08:00
}
namespace NS {
2013-12-05 15:51:02 +08:00
// Under DR482, these are all valid, except for forward-declaring a struct
// with a nested-name-specifier.
void NS : : foo ( ) ; // expected-warning {{extra qualification}}
extern int NS : : bar ; // expected-warning {{extra qualification}}
struct NS : : X ; // expected-error {{forward declaration of struct cannot have a nested name specifier}} expected-warning {{extra qualification}}
template < typename T > struct NS : : Y ; // expected-error {{forward declaration of struct cannot have a nested name specifier}} expected-warning {{extra qualification}}
template < typename T > void NS : : wibble ( T ) ; // expected-warning {{extra qualification}}
void NS : : foo ( ) { } // expected-warning{{extra qualification on member 'foo'}}
int NS : : bar ; // expected-warning{{extra qualification on member 'bar'}}
struct NS : : X { } ; // expected-warning{{extra qualification on member 'X'}}
template < typename T > struct NS : : Y { } ; // expected-warning{{extra qualification on member 'Y'}}
template < typename T > void NS : : wibble ( T ) { } // expected-warning{{extra qualification on member 'wibble'}}
2012-03-29 00:01:27 +08:00
}
2014-12-29 13:17:46 +08:00
struct : : { } a ; // expected-error{{expected identifier}}
2014-12-30 07:12:23 +08:00
struct NS : : Z : : { } b ; // expected-error{{expected identifier}}