File tree Expand file tree Collapse file tree 4 files changed +13
-3
lines changed Expand file tree Collapse file tree 4 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -352,6 +352,11 @@ Improvements to Clang's diagnostics
352
352
(with initializer) entirely consist the condition expression of a if/while/for construct
353
353
but are not actually used in the body of the if/while/for construct. Fixes #GH41447
354
354
355
+ - Clang emits a diagnostic when a tentative array definition is assumed to have
356
+ a single element, but that diagnostic was never given a diagnostic group.
357
+ Added the ``-Wtentative-definition-array `` warning group to cover this.
358
+ Fixes #GH87766
359
+
355
360
Improvements to Clang's time-trace
356
361
----------------------------------
357
362
Original file line number Diff line number Diff line change @@ -7142,7 +7142,8 @@ def ext_typecheck_decl_incomplete_type : ExtWarn<
7142
7142
def err_tentative_def_incomplete_type : Error<
7143
7143
"tentative definition has type %0 that is never completed">;
7144
7144
def warn_tentative_incomplete_array : Warning<
7145
- "tentative array definition assumed to have one element">;
7145
+ "tentative array definition assumed to have one element">,
7146
+ InGroup<DiagGroup<"tentative-definition-array">>;
7146
7147
def err_typecheck_incomplete_array_needs_initializer : Error<
7147
7148
"definition of variable with array type needs an explicit size "
7148
7149
"or an initializer">;
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ This test serves two purposes:
18
18
19
19
The list of warnings below should NEVER grow . It should gradually shrink to 0.
20
20
21
- CHECK : Warnings without flags (67 ):
21
+ CHECK : Warnings without flags (66 ):
22
22
23
23
CHECK - NEXT : ext_expected_semi_decl_list
24
24
CHECK - NEXT : ext_explicit_specialization_storage_class
@@ -80,7 +80,6 @@ CHECK-NEXT: warn_register_objc_catch_parm
80
80
CHECK - NEXT : warn_related_result_type_compatibility_class
81
81
CHECK - NEXT : warn_related_result_type_compatibility_protocol
82
82
CHECK - NEXT : warn_template_export_unsupported
83
- CHECK - NEXT : warn_tentative_incomplete_array
84
83
CHECK - NEXT : warn_typecheck_function_qualifiers
85
84
CHECK - NEXT : warn_undef_interface
86
85
CHECK - NEXT : warn_undef_interface_suggest
Original file line number Diff line number Diff line change
1
+ // RUN: %clang_cc1 -verify %s
2
+ // RUN: %clang_cc1 -verify=good -Wno-tentative-definition-array %s
3
+ // good-no-diagnostics
4
+
5
+ int foo []; // expected-warning {{tentative array definition assumed to have one element}}
You can’t perform that action at this time.
0 commit comments