C++0x [dcl.typedef]p4, take 3, where we actually figure out what "that

is not also a typedef-name" actually means. For anyone keeping score,
that's John: 2, Doug: 0.

llvm-svn: 93196
This commit is contained in:
Douglas Gregor 2010-01-11 22:30:10 +00:00
parent b53e826103
commit d615026e8d
2 changed files with 7 additions and 4 deletions

View File

@ -832,7 +832,7 @@ void Sema::MergeTypeDefDecl(TypedefDecl *New, LookupResult &OldDecls) {
// };
//
// since that was the intent of DR56.
if (isa<ElaboratedType>(New->getUnderlyingType()))
if (!isa<TypedefDecl >(Old))
return;
Diag(New->getLocation(), diag::err_redefinition)

View File

@ -2,11 +2,14 @@
struct S {
typedef struct A {} A; // expected-note {{previous definition is here}}
typedef struct B {} B;
typedef struct B B;
typedef A A; // expected-error {{redefinition of 'A'}}
struct C { }; // expected-note{{previous definition is here}}
struct C { };
typedef struct C OtherC;
typedef OtherC C; // expected-error{{redefinition of 'C'}}
typedef OtherC C;
typedef struct D { } D2;
typedef D2 D;
};