================ @@ -11432,6 +11433,22 @@ static QualType mergeEnumWithInteger(ASTContext &Context, const EnumType *ET, return {}; } +QualType ASTContext::mergeTagTypes(QualType LHS, QualType RHS) { + // C17 and earlier and C++ disallow two tag definitions within the same TU + // from being compatible. + if (LangOpts.CPlusPlus || !LangOpts.C23) + return {}; + + // C23, on the other hand, requires the members to be "the same enough", so + // we use a structural equivalence check. + StructuralEquivalenceContext::NonEquivalentDeclSet NonEquivalentDecls; + StructuralEquivalenceContext Ctx( + getLangOpts(), *this, *this, NonEquivalentDecls, + StructuralEquivalenceKind::Default, /*StrictTypeSpelling*/ false, + /*Complain*/ false, /*ErrorOnTagTypeMismatch*/ true); ---------------- shafik wrote:
```suggestion StructuralEquivalenceKind::Default, /*StrictTypeSpelling=*/false, /*Complain=*/false, /*ErrorOnTagTypeMismatch*=/true); ``` https://github.com/llvm/llvm-project/pull/132939 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits