Aaron Ballman 9eef4d1c5f
Remove delayed typo expressions (#143423)
This removes the delayed typo correction functionality from Clang
(regular typo correction still remains) due to fragility of the
solution.

An RFC was posted here:
https://discourse.llvm.org/t/rfc-removing-support-for-delayed-typo-correction/86631
and while that RFC was asking for folks to consider stepping up to be
maintainers, and we did have a few new contributors show some interest,
experiments show that it's likely worth it to remove this functionality
entirely and focus efforts on improving regular typo correction.

This removal fixes ~20 open issues (quite possibly more), improves
compile time performance by roughly .3-.4%
(https://llvm-compile-time-tracker.com/?config=Overview&stat=instructions%3Au&remote=AaronBallman&sortBy=date),
and does not appear to regress diagnostic behavior in a way we wouldn't
find acceptable.

Fixes #142457
Fixes #139913
Fixes #138850
Fixes #137867
Fixes #137860
Fixes #107840
Fixes #93308
Fixes #69470
Fixes #59391
Fixes #58172
Fixes #46215
Fixes #45915
Fixes #45891
Fixes #44490
Fixes #36703
Fixes #32903
Fixes #23312
Fixes #69874
2025-06-13 06:45:40 -04:00

98 lines
2.3 KiB
C

// RUN: %clang_cc1 -fsyntax-only -verify -pedantic -fblocks %s
// PR2241
float test2241[2] = {
1e, // expected-error {{exponent}}
1ee0 // expected-error {{exponent}}
};
// Testcase derived from PR2692
static void f (char * (*g) (char **, int), char **p, ...) {
char *s;
va_list v; // expected-error {{identifier}}
s = g (p, __builtin_va_arg(v, int)); // expected-error {{identifier}} expected-error {{extraneous ')' before ';'}}
}
// PR3172
} // expected-error {{extraneous closing brace ('}')}}
void test(int a) {
struct { int i; } x;
if (x.hello) // expected-error {{no member named 'hello'}}
test(0);
else
;
if (x.hello == 0) // expected-error {{no member named 'hello'}}
test(0);
else
;
if ((x.hello == 0)) // expected-error {{no member named 'hello'}}
test(0);
else
;
// PR12595
if (x.i == 0)) // expected-error {{extraneous ')' after condition, expected a statement}}
test(0);
else
;
}
char (((( /* expected-note {{to match this '('}} */
*X x ] )))); /* expected-error {{expected ')'}} */
; // expected-warning {{extra ';' outside of a function}}
struct S { void *X, *Y; };
struct S A = {
&BADIDENT, 0 /* expected-error {{use of undeclared identifier}} */
};
void test6248081(void) {
[10] // expected-error {{expected expression}}
}
struct forward; // expected-note{{forward declaration of 'struct forward'}}
void x(struct forward* x) {switch(x->a) {}} // expected-error {{incomplete definition of type}}
// PR3410
void foo(void) {
int X;
X = 4 // expected-error{{expected ';' after expression}}
}
void test9045701(int x) {
#define VALUE 0
x = VALUE // expected-error{{expected ';' after expression}}
}
typedef int intptr_t; // expected-note {{'intptr_t' declared here}}
void bar(intptr y); // expected-error {{unknown type name 'intptr'; did you mean 'intptr_t'?}}
void test1(void) {
int x = 2: // expected-error {{expected ';' at end of declaration}}
int y = x;
int z = y;
}
void test2(int x) {
#define VALUE2 VALUE+VALUE
#define VALUE3 VALUE+0
#define VALUE4(x) x+0
x = VALUE2 // expected-error{{expected ';' after expression}}
x = VALUE3 // expected-error{{expected ';' after expression}}
x = VALUE4(0) // expected-error{{expected ';' after expression}}
}