a more complete bugfix, this fixes the typedef type checking for arrays.

Index: Sema/SemaDecl.cpp
===================================================================
--- Sema/SemaDecl.cpp   (revision 46257)
+++ Sema/SemaDecl.cpp   (working copy)
@@ -296,8 +296,8 @@
   if (hasUndefinedLength(NewAT) || hasUndefinedLength(OldAT)) {
     if (NewAT->getIndexTypeQualifier() != OldAT->getIndexTypeQualifier())
       return false;
-    NewQType = NewAT->getElementType();
-    OldQType = OldAT->getElementType();
+    NewQType = NewAT->getElementType().getCanonicalType();
+    OldQType = OldAT->getElementType().getCanonicalType();
   }

   return NewQType == OldQType;
@@ -338,10 +338,12 @@
     return New;
   }
   // We've verified the types match, now check if Old is "extern".
+  /*
   if (Old->getStorageClass() != VarDecl::Extern) {
     Diag(New->getLocation(), diag::err_redefinition, New->getName());
     Diag(Old->getLocation(), diag::err_previous_definition);
   }
+  */
   return New;
 }
_______________________________________________
cfe-dev mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

Reply via email to