================
@@ -18563,6 +18556,58 @@ ExprResult Sema::ActOnCXXReflectExpr(SourceLocation
CaretCaretLoc,
ExprResult Sema::BuildCXXReflectExpr(SourceLocation CaretCaretLoc,
TypeSourceInfo *TSI) {
+ QualType QT = TSI->getType();
+ SourceLocation TypeLoc = TSI->getTypeLoc().getBeginLoc();
+
+ // Don't bother supporting VLAs here.
+ if (QT->isVariablyModifiedType()) {
+ Diag(TypeLoc, diag::err_reflect_variably_modified_type) << QT;
+ return ExprError();
+ }
+
+ // Canonicalize template arguments of alias template specializations.
+ //
+ // A parsed TST retains template arguments as written. Rebuild it with the
+ // canonical template declaration and normalized arguments so equivalent
+ // alias specializations have the same reflection identity.
+ //
+ // FIXME: This does mean that e.g. ^^A<1+2> becomes ^^A<3>; we might
+ // want to retain the original arguments somehow, but we need to make sure
+ // that doing so doesn't change the fact that ^^A<1+2> == ^^A<3>.
----------------
ojhunt wrote:
We could have a side table from the ReflectExpr to the TSI if the canonical
type is not the original? Not something needed now of course.
https://github.com/llvm/llvm-project/pull/232074
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits