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

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 14 16:38:56 PST 2018


rsmith added inline comments.


================
Comment at: clang/lib/AST/ExprConstant.cpp:10166-10182
+    EvalInfo Info(Ctx, Result, EvalInfo::EM_ConstantFold);
+    Info.IsNonTypeTemplateArgument = true;
+    LValue LV;
+    if (!EvaluateLValue(this, LV, Info) || Result.HasSideEffects ||
+        !CheckLValueConstantExpression(
+            Info, getExprLoc(), Ctx.getLValueReferenceType(getType()), LV))
+      return false;
----------------
Neither `EM_ConstantFold` nor `EM_IgnoreSideEffects` seem like the right evaluation modes to be using to evaluate a non-type template argument. I would expect `EM_ConstantExpression` to be used for both cases.


https://reviews.llvm.org/D43320





More information about the cfe-commits mailing list