Skip to content

Commit e652f82

Browse files
thebrandrecor3ntin
andcommitted
[clang] Reduce verbosity of comment and add FIXME
Co-authored-by: cor3ntin <[email protected]>
1 parent cfc5eb5 commit e652f82

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

clang/lib/Sema/SemaTemplateInstantiateDecl.cpp

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1571,18 +1571,11 @@ Decl *TemplateDeclInstantiator::VisitEnumDecl(EnumDecl *D) {
15711571
Enum->setIntegerType(SemaRef.Context.IntTy);
15721572
else
15731573
Enum->setIntegerTypeSourceInfo(NewTI);
1574-
1575-
// The following lines are relevant for opaque-enum-declarations.
1576-
// If users declare a full enum-specifier, the promotion type is reset
1577-
// again when parsing the (potentially empty) enumerator-list.
1578-
// We implement the same logic from C++11 [conv.prom] p4 here but only
1579-
// after template specialization [temp.spec.general] because it requires
1580-
// the concrete type.
1581-
// Note that (1) this also correctly handles the non-dependent case,
1582-
// (2) we set the promotion type for scoped enumerations to ensure
1583-
// consistency with declarations outside of templates, (3) we guarantee a
1584-
// valid promotion even if the user provided an invalid underlying type
1585-
// (fallback to "default int").
1574+
// C++23 [conv.prom]p4
1575+
// if integral promotion can be applied to its underlying type, a prvalue of an unscoped enumeration type
1576+
// whose underlying type is fixed can also be converted to a prvalue of the promoted underlying type.
1577+
//
1578+
// FIXME: that logic is already implemented in ActOnEnumBody, factor out into (Re)BuildEnumBody.
15861579
QualType UnderlyingType = Enum->getIntegerType();
15871580
Enum->setPromotionType(
15881581
SemaRef.Context.isPromotableIntegerType(UnderlyingType)

0 commit comments

Comments
 (0)