[clang] [C2y] Implement WG14 N3409 (PR #130299)

via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 7 08:33:26 PST 2025


================
@@ -10425,8 +10425,13 @@ def warn_type_safety_null_pointer_required : Warning<
   "specified %0 type tag requires a null pointer">, InGroup<TypeSafety>;
 
 // Generic selections.
-def err_assoc_type_incomplete : Error<
-  "type %0 in generic association incomplete">;
+def ext_assoc_type_incomplete : Extension<
+  "ISO C requires a complete type in a '_Generic' association; %0 is an "
+  "incomplete type">;
+def warn_c2y_compat_assoc_type_incomplete : Warning<
+  "use of an incomplete type in a '_Generic' association is incompatible with "
+  "C standards before C2y; %0 is an incomplete type">,
----------------
Sirraide wrote:

```suggestion
  "use of incomplete type %0 in a '_Generic' association is incompatible with "
  "C standards before C2y">,
```
We could also abbreviate this a bit like this maybe

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


More information about the cfe-commits mailing list