[clang] [clang][C23] N3006 Underspecified object declarations (PR #79845)

Guillot Tony via cfe-commits cfe-commits at lists.llvm.org
Sun Jul 7 09:37:37 PDT 2024


================
@@ -7813,6 +7813,32 @@ Sema::BuildCompoundLiteralExpr(SourceLocation LParenLoc, TypeSourceInfo *TInfo,
                                            diag::err_variable_object_no_init))
         return ExprError();
     }
+  } else if (LangOpts.C23 &&
----------------
to268 wrote:

3 out of these 5 cases are not conforming curently:
```cpp
constexpr typeof(struct s *) x = 0;               // Wrong, no underspecifed diagnostics
constexpr struct S { int a, b; } y = { 0 };       // Wrong, no underspecifed diagnostics
constexpr int a = 0, b = 0;                       // Ok, no underspecifed diagnostics
auto c = (struct T { int x, y; }){0, 0};          // Ok, `struct T` diagnosed as underspecifed
constexpr int (*fp)(struct X { int x; } val) = 0; // Wrong, no underspecifed diagnostics but dignoses warning: `declaration of 'struct X' will not be visible outside of this function`
```
I need to do more work outside of compound literals.

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


More information about the cfe-commits mailing list