}
if (!Previous.empty()) {
- NamedDecl *DirectPrevDecl = *Previous.begin();
- NamedDecl *PrevDecl = DirectPrevDecl->getUnderlyingDecl();
+ NamedDecl *PrevDecl = Previous.getFoundDecl();
+ NamedDecl *DirectPrevDecl =
+ getLangOpts().MSVCCompat ? *Previous.begin() : PrevDecl;
// It's okay to have a tag decl in the same scope as a typedef
// which hides a tag decl in the same scope. Finding this
}
+namespace using_tag_redeclaration
+{
+ struct S;
+ namespace N {
+ using ::using_tag_redeclaration::S;
+ struct S {}; // expected-note {{previous definition is here}}
+ }
+ void f() {
+ N::S s1;
+ S s2;
+ }
+ void g() {
+ struct S; // expected-note {{forward declaration of 'S'}}
+ S s3; // expected-error {{variable has incomplete type 'S'}}
+ }
+ void h() {
+ using ::using_tag_redeclaration::S;
+ struct S {}; // expected-error {{redefinition of 'S'}}
+ }
+}
+
namespace MissingTypename {
};
}
-namespace using_tag_redeclaration
-{
- struct S;
- namespace N {
- using ::using_tag_redeclaration::S;
- struct S {}; // expected-note {{previous definition is here}}
- }
- void f() {
- N::S s1;
- S s2;
- }
- void g() {
- struct S; // expected-note {{forward declaration of 'S'}}
- S s3; // expected-error {{variable has incomplete type 'S'}}
- }
- void h() {
- using ::using_tag_redeclaration::S;
- struct S {}; // expected-error {{redefinition of 'S'}}
- }
-}
-
// Don't suggest non-typenames for positions requiring typenames.
namespace using_suggestion_tyname_val {
namespace N { void FFF() {} }