[PATCH] D43320: Allow dllimport non-type template arguments in C++17

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 9 16:09:51 PDT 2018


rnk added inline comments.


================
Comment at: clang/include/clang/AST/Expr.h:670-672
+  /// Evaluate an expression that is required to be a core constant expression.
+  bool EvaluateAsCoreConstExpr(EvalResult &Result, QualType ParamType,
+                               CCEKind CCE, const ASTContext &Ctx) const;
----------------
rsmith wrote:
> Seems strange to pass a converted constant expression kind to an 'evaluate as core constant expression' function. And it seems like we don't need the kind here, just an "evaluating for emission w/relocations" vs "evaluating for mangling" enum.
> 
> Also, we need to evaluate non-type template arguments as constant expressions, not just as core constant expressions, which the implementation does, but the name and comment here don't reflect. (The difference is that you can't result in a pointer/reference to a temporary or automatic / thread storage duration entity.)
So... what are these things? Converted constant expressions? What are we evaluating them as? I guess they're not rvalues or lvalues.


https://reviews.llvm.org/D43320





More information about the cfe-commits mailing list