llvm-project
e734f01b - [clang] Prevent duplicated instantiation of enumerators of unscoped member enumerations (#124407)

Commit
249 days ago
[clang] Prevent duplicated instantiation of enumerators of unscoped member enumerations (#124407) This commit addresses a bug occurring when an unscoped member enumeration of a class template is introduced with an opaque-enum-declaration and later redeclared with an enum-specifier (per C++23 [class.mem] p6). Previously, the enumerators, or EnumConstantDecl, of the enum-specifier were instantiated at both declarations, leading to different issues: * erroneous ambiguities when referencing the enumerators, * duplicated diagnostics in the enumerator-list. The issue is resolved by ensuring that enumerators are instantiated only at the first instantiated declaration, analogous to nested classes. Fixes #124405
Author
Parents
Loading