[cfe-commits] r93196 - in /cfe/trunk: lib/Sema/SemaDecl.cpp test/CXX/dcl.dcl/dcl.spec/dcl.typedef/p4.cpp
Douglas Gregor
dgregor at apple.com
Mon Jan 11 14:30:10 PST 2010
Author: dgregor
Date: Mon Jan 11 16:30:10 2010
New Revision: 93196
URL: http://llvm.org/viewvc/llvm-project?rev=93196&view=rev
Log:
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.
Modified:
cfe/trunk/lib/Sema/SemaDecl.cpp
cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.typedef/p4.cpp
Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=93196&r1=93195&r2=93196&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Mon Jan 11 16:30:10 2010
@@ -832,7 +832,7 @@
// };
//
// since that was the intent of DR56.
- if (isa<ElaboratedType>(New->getUnderlyingType()))
+ if (!isa<TypedefDecl >(Old))
return;
Diag(New->getLocation(), diag::err_redefinition)
Modified: cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.typedef/p4.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.typedef/p4.cpp?rev=93196&r1=93195&r2=93196&view=diff
==============================================================================
--- cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.typedef/p4.cpp (original)
+++ cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.typedef/p4.cpp Mon Jan 11 16:30:10 2010
@@ -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;
};
More information about the cfe-commits
mailing list