rsmith reopened this revision. rsmith added inline comments. This revision is now accepted and ready to land.
================ Comment at: clang/lib/Sema/SemaTemplateInstantiateDecl.cpp:373-374 + ExplicitSpecifier ES, FunctionDecl *New) { + if (!ES.getExpr() || ES.getKind() != ExplicitSpecKind::Unresolved) + return ES; + Expr *OldCond = ES.getExpr(); ---------------- This is incorrect: you still need to substitute into an //explicit-specifier// even if you've already resolved it, at least if it's instantiation-dependent. (Substitution could fail, and if it does, you need to produce the error.) For example: ``` template<typename T> struct A { explicit(sizeof(sizeof(T::error)) == sizeof(sizeof(int))) A(); }; ``` Here, the expression in the //explicit-specifier// is neither type-dependent nor value-dependent, but it is instantiation-dependent, and substitution into it should fail when, say, `T` is `int`. (Instantiating `A<int>` should fail with an error.) CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60934/new/ https://reviews.llvm.org/D60934 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits