[clang] [Clang] Fix FixIt for implicit-int diagnostics. (PR #179356)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Feb 10 08:58:45 PST 2026
================
@@ -0,0 +1,57 @@
+// RUN: %clang_cc1 -std=c90 -pedantic -Wno-comment -Wno-deprecated-non-prototype -Wimplicit-int -verify=c90 -x c %s
+// RUN: cp %s %t
+// RUN: %clang_cc1 -std=c90 -pedantic -Wno-comment -Wno-deprecated-non-prototype -Wimplicit-int -fixit %t
+// RUN: %clang_cc1 -std=c90 -pedantic -Wno-comment -Wno-deprecated-non-prototype -Wimplicit-int -Werror -x c %t
+// RUN: cat %t | FileCheck %s
+// RUN: %clang_cc1 -std=c99 -pedantic -Wno-deprecated-non-prototype -verify=c99 -x c %s
+// RUN: cp %s %t
+// RUN: not %clang_cc1 -std=c99 -pedantic -Wno-deprecated-non-prototype -fixit %t
+// RUN: %clang_cc1 -std=c99 -pedantic -Wno-deprecated-non-prototype -Werror -x c %t
+// RUN: cat %t | FileCheck %s
+// RUN: %clang_cc1 -std=c23 -pedantic -verify=c23 -x c %s
+
+// CHECK: int imp0[4],imp1,imp2=5;
+imp0[4],imp1,imp2=5;
+// c90-warning at -1 {{type specifier missing, defaults to 'int'}}
+// c99-error at -2 {{type specifier missing, defaults to 'int'}}
----------------
Sirraide wrote:
We’re getting both a warning and and error for the same fecl group here? Is that right? Because I feel like we should only do one of the two
https://github.com/llvm/llvm-project/pull/179356
More information about the cfe-commits
mailing list