Skip to content

Commit b4abe8e

Browse files
committed
Update release notes and diagnostics for static local variables in extern inline functions
1 parent ee314e1 commit b4abe8e

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,10 @@ Improvements to Clang's diagnostics
402402
- Clang now emits a diagnostic in case `vector_size` or `ext_vector_type`
403403
attributes are used with a negative size (#GH165463).
404404

405+
- Clang now emits an extension warning (`ExtWarn`) instead of a regular warning
406+
for static local variables declared inside `extern inline` functions
407+
(#GH39524).
408+
405409
Improvements to Clang's time-trace
406410
----------------------------------
407411

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6339,11 +6339,9 @@ def warn_c2y_compat_internal_in_extern_inline : Warning<
63396339
"using static %select{function|variable}0 %1 in an inline function with "
63406340
"external linkage is incompatible with standards before C2y">,
63416341
InGroup<CPre2yCompat>, DefaultIgnore;
6342-
def warn_static_local_in_extern_inline
6343-
: ExtWarn<"non-constant static local variable in inline function may be "
6344-
"different "
6345-
"in different files">,
6346-
InGroup<StaticLocalInInline>;
6342+
def warn_static_local_in_extern_inline : ExtWarn<
6343+
"non-constant static local variable in inline function may be different "
6344+
"in different files">, InGroup<StaticLocalInInline>;
63476345
def note_convert_inline_to_static : Note<
63486346
"use 'static' to give inline function %0 internal linkage">;
63496347

0 commit comments

Comments
 (0)