rsmith added inline comments.

================
Comment at: lib/Sema/SemaDecl.cpp:3370-3374
@@ -3369,7 +3369,7 @@
       // mismatch.
-      if (!NewArray->isIncompleteArrayType()) {
+      if (!NewArray->isIncompleteArrayType() && !NewArray->isDependentType()) {
         for (VarDecl *PrevVD = Old->getMostRecentDecl(); PrevVD;
              PrevVD = PrevVD->getPreviousDecl()) {
           const ArrayType *PrevVDTy = 
Context.getAsArrayType(PrevVD->getType());
-          if (PrevVDTy->isIncompleteArrayType())
+          if (PrevVDTy->isIncompleteArrayType() || PrevVDTy->isDependentType())
             continue;
----------------
Maybe use `isDependentSizedArrayType()` here instead, so we still diagnose 
cases where the element type is dependent but the array bound is non-dependent 
and differs.


https://reviews.llvm.org/D24110



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to