[cfe-commits] r95096 - /cfe/trunk/lib/AST/Decl.cpp
Sebastian Redl
sebastian.redl at getdesigned.at
Tue Feb 2 09:55:12 PST 2010
Author: cornedbee
Date: Tue Feb 2 11:55:12 2010
New Revision: 95096
URL: http://llvm.org/viewvc/llvm-project?rev=95096&view=rev
Log:
Fix a C++ regression where redefinitions weren't diagnosed.
Modified:
cfe/trunk/lib/AST/Decl.cpp
Modified: cfe/trunk/lib/AST/Decl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Decl.cpp?rev=95096&r1=95095&r2=95096&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Decl.cpp (original)
+++ cfe/trunk/lib/AST/Decl.cpp Tue Feb 2 11:55:12 2010
@@ -553,7 +553,9 @@
}
VarDecl *VarDecl::getDefinition() {
- for (redecl_iterator I = redecls_begin(), E = redecls_end(); I != E; ++I) {
+ VarDecl *First = getFirstDeclaration();
+ for (redecl_iterator I = First->redecls_begin(), E = First->redecls_end();
+ I != E; ++I) {
if ((*I)->isThisDeclarationADefinition() == Definition)
return *I;
}
More information about the cfe-commits
mailing list