File: cxx-delayed-typo-correction-crashes.cpp

package info (click to toggle)
llvm-toolchain-21 1%3A21.1.6-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,245,028 kB
  • sloc: cpp: 7,619,726; ansic: 1,434,018; asm: 1,058,748; python: 252,740; f90: 94,671; objc: 70,685; lisp: 42,813; pascal: 18,401; sh: 8,601; ml: 5,111; perl: 4,720; makefile: 3,675; awk: 3,523; javascript: 2,409; xml: 892; fortran: 770
file content (67 lines) | stat: -rw-r--r-- 3,469 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// RUN: %clang_cc1 -fsyntax-only -verify %s

namespace GH138850 {
void test() {
  int tmp = add(int, 0, 0);    // expected-error {{expected '(' for function-style cast or type construction}} \
                                  expected-note {{previous definition is here}}
  uint tmp = add(uint, 1, 1);  // expected-error {{use of undeclared identifier 'uint'; did you mean 'int'?}} \
                                  expected-error {{redefinition of 'tmp'}} \
                                  expected-error {{use of undeclared identifier 'uint'}}
  call(void, f, (int)tmp);     // expected-error {{expected '(' for function-style cast or type construction}} \
                                  expected-error {{use of undeclared identifier 'f'}}
}
}

namespace GH107840 {
struct tm {};          // expected-note {{'tm' declared here}}

auto getCache = [&] {  // expected-error {{non-local lambda expression cannot have a capture-default}}
  ::foo([=] {          // expected-error {{no member named 'foo' in the global namespace}}
    tms time;          // expected-error {{unknown type name 'tms'; did you mean 'tm'?}}
    (void)time;
  });
};
}

namespace GH59391 {
template <typename b> class c {
  c(b);
  b e;
  void f() {
    for (auto core : a::c(cores)) { // expected-error {{use of undeclared identifier 'cores'}} \
                                       expected-error {{use of undeclared identifier 'a'}}
    }
  }
};
}

namespace GH45915 {
short g_volatile_ushort;                   // expected-note {{'g_volatile_ushort' declared here}}
namespace a {
   int b = l_volatile_uwchar.a ::c ::~d<>; // expected-error {{use of undeclared identifier 'l_volatile_uwchar'}} \
                                              expected-error {{no member named 'd' in namespace 'GH45915::a'}}
}
}

namespace GH45891 {
int a = b.c < enum , > :: template ~d < > [ e; // expected-error {{use of undeclared identifier 'b'}} \
                                                  expected-error {{expected identifier or '{'}} \
                                                  expected-error {{expected ';' after top level declarator}}
}

namespace GH32903 {
void
B(
  char cat_dog_3, char cat_dog_2, char cat_dog_1, char cat_dog_0, char pigeon_dog_3, char pigeon_dog_2,
  char pigeon_dog_1, char pigeon_dog_0, short &elefant15_lion, short &elefant14_lion, short &elefant13_lion,       // expected-note 3 {{declared here}}
  short &elefant12_lion, short &elefant11_lion, short &elefant10_lion, short &elefant9_lion, short &elefant8_lion, // expected-note 5 {{declared here}}
  short &elefant7_lion, short &elefant6_lion, short &elefant5_lion, short &elefant4_lion, short &elefant3_lion,    // expected-note 2 {{declared here}}
  short &elefant2_lion, short &elefant1_lion, short &elefant0_lion, char& no_animal)
{

    A(  // FIXME: it's surprising that we don't issue a "use of undeclared identifier" diagnostic for the call itself.
        elefant_15_lion, elefant_14_lion, elefant_13_lion, elefant_12_lion, elefant_11_lion, elefant_10_lion, elefant_9_lion, // expected-error 7 {{use of undeclared identifier}}
        elefant_8_lion, elefant_7_lion, elefant_6_lion, elefant_5_lion, elefant_4_lion, elefant_3_lion, elefant_2_lion,       // expected-error 7 {{use of undeclared identifier}}
        elefant_1_lion, elefant_0_lion, no_animal, other_mammal);                                                             // expected-error 3 {{use of undeclared identifier}}
}
}