[cfe-dev] bugfix(1908): http://llvm.org/bugs/show_bug.cgi?id=1908

Csaba Hruska csaba.hruska at gmail.com
Tue Jan 22 14:23:02 PST 2008


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;
 }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20080122/f14f663f/attachment.html>


More information about the cfe-dev mailing list