[PATCH] D54355: Use is.constant intrinsic for __builtin_constant_p

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 19 14:23:27 PST 2018


rsmith added a comment.

Looks good other than the ODR violation issue.



================
Comment at: include/clang/AST/Expr.h:37-39
+namespace {
+struct EvalInfo;
+}
----------------
It's not appropriate to declare internal-linkage types in headers. This will create ODR violations, and appears to be unnecessary -- the extra `EvaluateAsRValue` overload you declare below is not callable outside of `ExprConstant.cpp`, so can instead be declared as an internal linkage function in that file.


Repository:
  rC Clang

https://reviews.llvm.org/D54355





More information about the cfe-commits mailing list