Redecl chains of class template specializations are not handled well
currently. We want to handle them similarly to functions, i.e. try to
keep the structure of the original AST as much as possible. The aim is
to not squash a prototype with a definition, rather we create both and
put them in a redecl chain.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/AST/ASTImporter.cpp | ||
---|---|---|
5147 ↗ | (On Diff #189131) | ODR violations are ill-formed no diagnostic required. So currently will this fail for cases that clang proper would not? |
lib/AST/ASTImporter.cpp | ||
---|---|---|
5147 ↗ | (On Diff #189131) |
ASTStructuralEquivalenceContext already provides diagnostic in the ODR cases. E.g.: // Check for equivalent field names. IdentifierInfo *Name1 = Field1->getIdentifier(); IdentifierInfo *Name2 = Field2->getIdentifier(); if (!::IsStructurallyEquivalent(Name1, Name2)) { if (Context.Complain) { Context.Diag2(Owner2->getLocation(), Context.ErrorOnTagTypeMismatch ? diag::err_odr_tag_type_inconsistent : diag::warn_odr_tag_type_inconsistent) << Context.ToCtx.getTypeDeclType(Owner2); Context.Diag2(Field2->getLocation(), diag::note_odr_field_name) << Field2->getDeclName(); Context.Diag1(Field1->getLocation(), diag::note_odr_field_name) << Field1->getDeclName(); } return false; } We change this to be always a Warning instead of an Error in this patch: https://reviews.llvm.org/D58897
Well, I think the situation is more subtle than that. |