[clang] [C23] Implement N3018: The constexpr specifier for object definitions (PR #73099)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 28 09:00:01 PST 2023


================
@@ -2231,6 +2231,12 @@ static bool CheckLValueConstantExpression(EvalInfo &Info, SourceLocation Loc,
     return false;
   }
 
+  if (Info.getLangOpts().C23) {
----------------
AaronBallman wrote:

```suggestion
  // C23 6.7.1p6: If an object or subobject declared with storage-class specifier constexpr has pointer, 
  // integer, or arithmetic type, any explicit initializer value for it shall be null, an integer constant 
  // expression, or an arithmetic constant expression, respectively.
  if (Info.getLangOpts().C23) {
```
May need to adjust for 80-col limits.

https://github.com/llvm/llvm-project/pull/73099


More information about the cfe-commits mailing list