On Mon, May 18, 2009 at 11:29 AM, Douglas Gregor <dgre...@apple.com> wrote: >> @@ -916,7 +916,13 @@ >> MergeAttributes(New, Old, Context); >> >> // Merge the types >> - QualType MergedT = Context.mergeTypes(New->getType(), Old->getType()); >> + QualType MergedT; >> + if (getLangOptions().CPlusPlus) { >> + if (Context.hasSameType(New->getType(), Old->getType())) >> + MergedT = New->getType(); >> + } else { >> + MergedT = Context.mergeTypes(New->getType(), Old->getType()); >> + } >> if (MergedT.isNull()) { >> Diag(New->getLocation(), diag::err_redefinition_different_type) >> << New->getDeclName(); > > This is slightly too strict in C++, because it's okay to redeclare a > variable that has an incomplete type with a complete type (and vice versa). > Here's a test case that used to work in C++ but doesn't now: > > extern int array[10]; > extern int array[]; > extern int array[10];
Okay. I can fix it if you want; can you give me a citation for the rules? -Eli _______________________________________________ cfe-commits mailing list cfe-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits