[clang] [clang] Diagnose default arguments defined in different scopes (PR #124844)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 29 01:35:52 PST 2025
================
@@ -27,3 +27,23 @@ extern double(*func2)(
P_10000(int u)
P_10000(int v) // expected-error {{too many function parameters; subsequent parameters will be ignored}}
int w);
+
+#define PD_10(x) x, x, x, x, x, x, x, x, x, x,
+#define PD_100(x) PD_10(x) PD_10(x) PD_10(x) PD_10(x) PD_10(x) \
+ PD_10(x) PD_10(x) PD_10(x) PD_10(x) PD_10(x)
+#define PD_1000(x) PD_100(x) PD_100(x) PD_100(x) PD_100(x) PD_100(x) \
+ PD_100(x) PD_100(x) PD_100(x) PD_100(x) PD_100(x)
+#define PD_10000(x) PD_1000(x) PD_1000(x) PD_1000(x) PD_1000(x) PD_1000(x) \
+ PD_1000(x) PD_1000(x) PD_1000(x) PD_1000(x) PD_1000(x)
+
+extern "C" int func3(
+ PD_10000(int = 0)
+ PD_10000(int = 0)
+ PD_10000(int = 0)
+ PD_10000(int = 0)
+ PD_10000(int = 0)
+ PD_10000(int = 0)
+ PD_10000(int = 0) // expected-error {{too many function parameters; subsequent parameters will be ignored}}
+ int = 0);
+
+int h = func3();
----------------
cor3ntin wrote:
Is that really related to the change?
https://github.com/llvm/llvm-project/pull/124844
More information about the cfe-commits
mailing list