redeclaration of an enum type differs from that of the original
declaration, from Daniel Wallin
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120577
91177308-0d34-0410-b5e6-
96231b3b80d8
def err_enumerator_wrapped : Error<
"enumerator value %0 is not representable in the underlying type %1">;
def err_enum_redeclare_type_mismatch : Error<
- "enumeration redeclared with different underlying type">;
+ "enumeration redeclared with different underlying type %0 (was %1)">;
def err_enum_redeclare_fixed_mismatch : Error<
"enumeration previously declared with %select{non|}0fixed underlying type">;
def err_enum_redeclare_scoped_mismatch : Error<
T = QualType(EnumUnderlying.get<const Type*>(), 0);
if (!Context.hasSameUnqualifiedType(T, PrevEnum->getIntegerType())) {
- Diag(KWLoc, diag::err_enum_redeclare_type_mismatch);
+ Diag(NameLoc.isValid() ? NameLoc : KWLoc,
+ diag::err_enum_redeclare_type_mismatch)
+ << T
+ << PrevEnum->getIntegerType();
Diag(PrevTagDecl->getLocation(), diag::note_previous_use);
return PrevTagDecl;
}