faisalv added a comment.
Thanks for working on this fairly embarrassing bug (let's fix this before the
week is over :)
================
Comment at: clang/lib/Sema/SemaDecl.cpp:12886
if (!IsInstantiation && FD && FD->isConstexpr() && !FD->isInvalidDecl() &&
+ !isLambdaCallOperator(FD) &&
(!CheckConstexprFunctionDecl(FD) ||
----------------
Hmm - as opposed to further leaking our lambda's implementation-details into
ActOnFinishFunctionBody - and duplicating these checks for a lambda marked
constexpr, I think I would prefer teaching the expression-evaluator
(ExprConstant.cpp) to know how to check a lambda's function call operator for
constexprness (i.e. avoid creating the capture-to-field-map when
'checkingPotentialConstantExpression()' and ignore evaluating expressions that
refer to enclosing variables since their evaluation should not affect inferring
constexprness).
Thoughts?
Repository:
rC Clang
https://reviews.llvm.org/D45194
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits