rsmith added inline comments.
================ Comment at: clang/lib/AST/ASTContext.cpp:5446 // Build a new, canonical decltype(expr) type. Canon = new (*this, TypeAlignment) DependentDecltypeType(*this, e); DependentDecltypeTypes.InsertNode(Canon, InsertPos); ---------------- If we don't track the extra parens here too, we can end up giving the same canonical type to dependent `decltype` types with and without implicit parens, even though they can instantiate to different types. (But I think the simplest way to handle this would be to include the parens in the expression; see other comment.) ================ Comment at: clang/lib/Sema/SemaExprCXX.cpp:8643 QualType MatchedType = - BuildDecltypeType(E, E->getBeginLoc()).getCanonicalType(); + BuildDecltypeType(E, E->getBeginLoc(), true, true).getCanonicalType(); llvm::SmallVector<TemplateArgument, 1> Args; ---------------- Instead of adding complexity to the type system to deal with this special case, can you directly create a `ParenExpr` here? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D98160/new/ https://reviews.llvm.org/D98160 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits