diff --git a/clang/lib/AST/ASTImporter.cpp b/clang/lib/AST/ASTImporter.cpp --- a/clang/lib/AST/ASTImporter.cpp +++ b/clang/lib/AST/ASTImporter.cpp @@ -3447,12 +3447,15 @@ return FoundField; } - // FIXME: Why is this case not handled with calling HandleNameConflict? Importer.ToDiag(Loc, diag::warn_odr_field_type_inconsistent) << Name << D->getType() << FoundField->getType(); Importer.ToDiag(FoundField->getLocation(), diag::note_odr_value_here) << FoundField->getType(); - + // This case is not handled with HandleNameConflict, because by the time + // when we reach here, the enclosing class is already imported. If there + // was any NameConflict during the import of that class it is already + // handled. (Otherwise we have a contradiction between the structural + // equivalency check of that class and its field [this field].) return make_error(ImportError::NameConflict); } } @@ -3518,12 +3521,15 @@ if (!Name && I < N-1) continue; - // FIXME: Why is this case not handled with calling HandleNameConflict? Importer.ToDiag(Loc, diag::warn_odr_field_type_inconsistent) << Name << D->getType() << FoundField->getType(); Importer.ToDiag(FoundField->getLocation(), diag::note_odr_value_here) << FoundField->getType(); - + // This case is not handled with HandleNameConflict, because by the time + // when we reach here, the enclosing class is already imported. If there + // was any NameConflict during the import of that class it is already + // handled. (Otherwise we have a contradiction between the structural + // equivalency check of that class and its field [this field].) return make_error(ImportError::NameConflict); } } @@ -5248,7 +5254,12 @@ return PrevDecl; } } else { // ODR violation. - // FIXME HandleNameConflict + // This is not a name conflict, we have specializations with same + // parameters, but with different definitions. + // HandleNameConflict cannot be used here and Liberal strategy could not + // work because we cannot register two specializations for a primary + // template. + // FIXME Perhaps return with a different error? return make_error(ImportError::NameConflict); } }