rnk added a comment.
Thanks for the guidance!
Comment at: clang/lib/AST/ExprConstant.cpp:1871-1902
if (!CheckConstantExpression(Info, DiagLoc, EltTy,
Value.getArrayInitializedElt(I)))
return false;
}
if
This revision was automatically updated to reflect the committed changes.
Closed by commit rC332018: Allow dllimport non-type template arguments in C++17
(authored by rnk, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D43320?vs=146039=146178#toc
Repository:
rC Clang
rsmith accepted this revision.
rsmith added inline comments.
This revision is now accepted and ready to land.
Comment at: clang/lib/AST/ExprConstant.cpp:1871-1902
if (!CheckConstantExpression(Info, DiagLoc, EltTy,
rnk added inline comments.
Comment at: clang/include/clang/AST/Expr.h:662
+ /// Indicates how the constant expression will be used.
+ enum ConstExprUsage { EvaluateForCodeGen, EvaluateForMangling };
+
I expect we could come up with a better name, but is this
rnk updated this revision to Diff 146039.
rnk added a comment.
- getting closer
https://reviews.llvm.org/D43320
Files:
clang/include/clang/AST/Expr.h
clang/lib/AST/ExprConstant.cpp
clang/lib/Sema/SemaOverload.cpp
clang/test/SemaCXX/dllimport-constexpr.cpp
rsmith 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 , QualType ParamType,
+ CCEKind CCE, const
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 , QualType ParamType,
+ CCEKind CCE, const
rnk updated this revision to Diff 146025.
rnk added a comment.
- don't expose CCEK, use a bool
https://reviews.llvm.org/D43320
Files:
clang/include/clang/AST/Expr.h
clang/lib/AST/ExprConstant.cpp
clang/lib/Sema/SemaOverload.cpp
clang/test/SemaCXX/dllimport-constexpr.cpp
rsmith added inline comments.
Comment at: clang/include/clang/AST/Expr.h:103
+/// Contexts in which a converted constant expression is required.
+enum CCEKind {
+ CCEK_CaseValue, ///< Expression in a case label.
If we end up moving this out of `Sema` into the
rnk updated this revision to Diff 134510.
rnk added a comment.
- revise as discussed
https://reviews.llvm.org/D43320
Files:
clang/include/clang/AST/Expr.h
clang/include/clang/Sema/Sema.h
clang/lib/AST/ExprConstant.cpp
clang/lib/Sema/SemaOverload.cpp
rnk 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 ||
+
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 ||
+
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 ||
+
rnk created this revision.
rnk added a reviewer: rsmith.
When the C++ committee changed the wording around non-type template
arguments, they naively thought that every global declarations address
would be a constant expression, but this is not the case. There is no
PE/COFF relocation that allows
14 matches
Mail list logo