tbaeder added inline comments.
================ Comment at: clang/lib/AST/Interp/ByteCodeEmitter.cpp:100-103 + bool IsEligibleForCompilation = + FuncDecl->isConstexpr() || + (isa<CXXMethodDecl>(FuncDecl) && + cast<CXXMethodDecl>(FuncDecl)->isLambdaStaticInvoker()); ---------------- aaron.ballman wrote: > I don't like the `isa` followed by a `cast` code smell, but rewriting it to > use `dyn_cast` is perhaps kind of ugly: > ``` > bool IsEligibleForCompilation = false; > if (const auto *MD = dyn_cast<CXXMethodDecl>()) > IsEligibleForCompilation = MD->isLambdaStaticInvoker(); > if (!IsEligibleForCompilation) > IsEligibleForCompilation = FuncDecl->isConstexpr(); > ``` > WDYT? I'm not a fan of that pattern either. I've seen it elsewhere in the code base, didn't like it, but couldn't come up with an objective downside either. If you're also not a fan, I have no problem with changing it. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D150111/new/ https://reviews.llvm.org/D150111 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits