1 // RUN: %clang_cc1 -fspell-checking-limit=0 -verify -Wno-c++11-extensions -fcxx-exceptions %s
2 // RUN: %clang_cc1 -fspell-checking-limit=0 -verify -Wno-c++11-extensions -fcxx-exceptions -std=c++20 %s
5 int a(-rsing
[2]); // expected-error {{undeclared identifier 'rsing'; did you mean 'using'?}}
6 // expected-error@-1 {{expected expression}}
11 operator int() const {return v_
;}
18 error_condition() : _val_(0) {}
20 error_condition(int _val
)
24 error_condition(E _e
) {
25 // make_error_condition must not be typo corrected to error_condition
26 // even though the first declaration of make_error_condition has not
27 // yet been encountered. This was a bug in the first version of the type
28 // name typo correction patch that wasn't noticed until building LLVM with
30 *this = make_error_condition(_e
);
35 inline error_condition
make_error_condition(errc _e
) {
36 return error_condition(static_cast<int>(_e
));
40 // Prior to the introduction of a callback object to further filter possible
41 // typo corrections, this example would not trigger a suggestion as "base_type"
42 // is a closer match to "basetype" than is "BaseType" but "base_type" does not
43 // refer to a base class or non-static data member.
45 struct Derived
: public BaseType
{ // expected-note {{base class 'BaseType' specified here}}
46 static int base_type
; // expected-note {{'base_type' declared here}}
47 Derived() : basetype() {} // expected-error{{initializer 'basetype' does not name a non-static data member or base class; did you mean the base class 'BaseType'?}}
50 // Test the improvement from passing a callback object to CorrectTypo in
51 // the helper function LookupMemberExprInRecord.
52 int get_type(struct Derived
*st
) {
53 return st
->Base_Type
; // expected-error{{no member named 'Base_Type' in 'Derived'; did you mean 'base_type'?}}
56 // In this example, somename should not be corrected to the cached correction
57 // "some_name" since "some_name" is a class and a namespace name is needed.
58 class some_name
{}; // expected-note {{'some_name' declared here}}
59 somename Foo
; // expected-error {{unknown type name 'somename'; did you mean 'some_name'?}}
60 namespace SomeName
{} // expected-note {{namespace 'SomeName' defined here}}
61 using namespace somename
; // expected-error {{no namespace named 'somename'; did you mean 'SomeName'?}}
64 // Without the callback object, CorrectTypo would choose "field1" as the
65 // correction for "fielda" as it is closer than "FieldA", but that correction
66 // would be later discarded by the caller and no suggestion would be given.
71 double FieldA
; // expected-note{{'FieldA' declared here}}
73 st var
= { .fielda
= 0.0 }; // expected-error{{field designator 'fielda' does not refer to any field in type 'st'; did you mean 'FieldA'?}}
75 // Test the improvement from passing a callback object to CorrectTypo in
76 // Sema::BuildCXXNestedNameSpecifier. And also for the improvement by doing
77 // so in Sema::getTypeName.
78 typedef char* another_str
; // expected-note{{'another_str' declared here}}
79 namespace AnotherStd
{ // expected-note{{'AnotherStd' declared here}}
82 another_std::string str
; // expected-error{{use of undeclared identifier 'another_std'; did you mean 'AnotherStd'?}}
83 another_str
*cstr
= new AnotherStr
; // expected-error{{unknown type name 'AnotherStr'; did you mean 'another_str'?}}
85 // Test the improvement from passing a callback object to CorrectTypo in
86 // Sema::ActOnSizeofParameterPackExpr.
88 template<typename
...TypeNames
> struct count
{ // expected-note{{parameter pack 'TypeNames' declared here}}
89 static const unsigned value
= sizeof...(TyreNames
); // expected-error{{'TyreNames' does not refer to the name of a parameter pack; did you mean 'TypeNames'?}}
92 // Test the typo-correction callback in Sema::DiagnoseUnknownTypeName.
93 namespace unknown_type_test
{
94 class StreamOut
{}; // expected-note 2 {{'StreamOut' declared here}}
95 long stream_count
; // expected-note 2 {{'stream_count' declared here}}
97 unknown_type_test::stream_out out
; // expected-error{{no type named 'stream_out' in namespace 'unknown_type_test'; did you mean 'StreamOut'?}}
99 // Demonstrate a case where using only the cached value returns the wrong thing
100 // when the cached value was the result of a previous callback object that only
101 // accepts a subset of the current callback object.
102 namespace cache_invalidation_test
{
103 using namespace unknown_type_test
;
105 void before_caching_classname() {
106 bar((stream_out
)); // expected-error{{use of undeclared identifier 'stream_out'; did you mean 'stream_count'?}}
108 stream_out out
; // expected-error{{unknown type name 'stream_out'; did you mean 'StreamOut'?}}
109 void after_caching_classname() {
110 bar((stream_out
)); // expected-error{{use of undeclared identifier 'stream_out'; did you mean 'stream_count'?}}
114 // Test the typo-correction callback in Sema::DiagnoseInvalidRedeclaration.
118 struct TestRedecl
: public BaseDecl
{
119 void add_it(int i
); // expected-note{{'add_it' declared here}}
121 void TestRedecl::add_in(int i
) {} // expected-error{{out-of-line definition of 'add_in' does not match any declaration in 'TestRedecl'; did you mean 'add_it'?}}
123 // Test the improved typo correction for the Parser::ParseCastExpr =>
124 // Sema::ActOnIdExpression => Sema::DiagnoseEmptyLookup call path.
125 class SomeNetMessage
; // expected-note 2{{'SomeNetMessage'}}
128 void foo(SomeNetMessage
&);
129 void doit(void *data
) {
130 Message somenetmsg
; // expected-note{{'somenetmsg' declared here}}
131 foo(somenetmessage
); // expected-error{{use of undeclared identifier 'somenetmessage'; did you mean 'somenetmsg'?}}
132 foo((somenetmessage
)data
); // expected-error{{unknown type name 'somenetmessage'; did you mean 'SomeNetMessage'?}} expected-error{{incomplete type}}
135 // Test the typo-correction callback in BuildRecoveryCallExpr.
136 // Solves the main issue in PR 9320 of suggesting corrections that take the
137 // wrong number of arguments.
138 void revoke(const char*); // expected-note 2{{'revoke' declared here}}
140 Invoke(); // expected-error{{use of undeclared identifier 'Invoke'}}
141 Invoke("foo"); // expected-error{{use of undeclared identifier 'Invoke'; did you mean 'revoke'?}}
142 Invoke("foo", "bar"); // expected-error{{use of undeclared identifier 'Invoke'}}
144 void Test2(void (*invoke
)(const char *, int)) { // expected-note{{'invoke' declared here}}
145 Invoke(); // expected-error{{use of undeclared identifier 'Invoke'}}
146 Invoke("foo"); // expected-error{{use of undeclared identifier 'Invoke'; did you mean 'revoke'?}}
147 Invoke("foo", 7); // expected-error{{use of undeclared identifier 'Invoke'; did you mean 'invoke'?}}
148 Invoke("foo", 7, 22); // expected-error{{use of undeclared identifier 'Invoke'}}
151 void provoke(const char *x
, bool y
=false) {} // expected-note 2{{'provoke' declared here}}
153 Provoke(); // expected-error{{use of undeclared identifier 'Provoke'}}
154 Provoke("foo"); // expected-error{{use of undeclared identifier 'Provoke'; did you mean 'provoke'?}}
155 Provoke("foo", true); // expected-error{{use of undeclared identifier 'Provoke'; did you mean 'provoke'?}}
156 Provoke("foo", 7, 22); // expected-error{{use of undeclared identifier 'Provoke'}}
159 // PR 11737 - Don't try to typo-correct the implicit 'begin' and 'end' in a
160 // C++11 for-range statement.
164 for (auto b
: R()) {} // expected-error {{invalid range expression of type 'R'}}
167 // PR 12019 - Avoid infinite mutual recursion in DiagnoseInvalidRedeclaration
168 // by not trying to typo-correct a method redeclaration to declarations not
169 // in the current record.
171 void set_types(int index
, int value
);
172 void add_types(int value
);
174 class Child
: public Parent
{};
175 void Child::add_types(int value
) {} // expected-error{{out-of-line definition of 'add_types' does not match any declaration in 'Child'}}
177 // Fix the callback based filtering of typo corrections within
178 // Sema::ActOnIdExpression by Parser::ParseCastExpression to allow type names as
179 // potential corrections for template arguments.
181 class ConstructExpr
{}; // expected-note 2{{'clash::ConstructExpr' declared here}}
184 bool HaveConstructExpr();
185 template <class T
> T
* getExprAs();
188 ConstructExpr
*expr
= // expected-error{{unknown type name 'ConstructExpr'; did you mean 'clash::ConstructExpr'?}}
189 getExprAs
<ConstructExpr
>(); // expected-error{{unknown type name 'ConstructExpr'; did you mean 'clash::ConstructExpr'?}}
195 struct Foobar
*f
; // expected-note{{'Foobar' declared here}}
197 test1::FooBar
*b
; // expected-error{{no type named 'FooBar' in namespace 'test1'; did you mean 'Foobar'?}}
200 namespace ImplicitInt
{
201 void f(int, unsinged
); // expected-error{{did you mean 'unsigned'}}
203 unsinged
: 4; // expected-error{{did you mean 'unsigned'}}
208 template<typename T
> struct S
{
209 template<typename U
> void f();
210 operator bool() const;
213 void foo(); // expected-note{{'foo' declared here}}
214 void g(void(*)()); // expected-note{{candidate function not viable}}
215 void g(bool(S
<int>::*)() const); // expected-note{{candidate function not viable}}
218 g(&S
<int>::tempalte f
<int>); // expected-error{{did you mean 'template'?}} \
219 // expected-error{{no matching function for call to 'g'}}
220 g(&S
<int>::opeartor
bool); // expected-error{{did you mean 'operator'?}}
221 g(&S
<int>::foo
); // expected-error{{no member named 'foo' in 'PR13051::S<int>'; did you mean simply 'foo'?}}
225 inf
f(doulbe
); // expected-error{{'int'}} expected-error{{'double'}}
228 class foo
{ }; // expected-note{{'foo' declared here}}
229 // Note that for this example (pulled from the PR), if keywords are not excluded
230 // as correction candidates then no suggestion would be given; correcting
231 // 'boo' to 'bool' is the same edit distance as correcting 'boo' to 'foo'.
232 class bar
: boo
{ }; // expected-error{{unknown class name 'boo'; did you mean 'foo'?}}
236 void somefunc(); // expected-note{{'::outer::somefunc' declared here}}
237 void somefunc(int, int); // expected-note{{'::outer::somefunc' declared here}}
241 someFunc(); // expected-error{{use of undeclared identifier 'someFunc'; did you mean '::outer::somefunc'?}}
242 someFunc(1, 2); // expected-error{{use of undeclared identifier 'someFunc'; did you mean '::outer::somefunc'?}}
247 namespace b6956809_test1
{
252 void method(A
*); // no note here
253 void method(B
*); // expected-note{{'method' declared here}}
259 s
.methodd(&b
); // expected-error{{no member named 'methodd' in 'b6956809_test1::S1'; did you mean 'method'}}
264 void method(A
*) const;
272 s
.methodd(&b
); // expected-error-re{{no member named 'methodd' in 'b6956809_test1::S2'{{$}}}}
276 namespace b6956809_test2
{
277 template<typename T
> struct Err
{ typename
T::error n
; }; // expected-error{{type 'void *' cannot be used prior to '::' because it has no members}}
279 template<typename T
> typename Err
<T
>::type
method(T
); // expected-note{{in instantiation of template class 'b6956809_test2::Err<void *>' requested here}}
280 template<typename T
> int method(T
*); // expected-note{{'method' declared here}}
285 int k
= s
.methodd((void*)0); // expected-error{{no member named 'methodd' in 'b6956809_test2::S'; did you mean 'method'?}} expected-note{{while substituting deduced template arguments into function template 'method' [with T = void *]}}
290 // If there are two corrections that have the same identifier and edit distance
291 // and only differ by their namespaces, don't suggest either as a correction
292 // since both are equally likely corrections.
293 namespace foobar
{ struct Thing
{}; }
294 namespace bazquux
{ struct Thing
{}; }
295 void f() { Thing t
; } // expected-error{{unknown type name 'Thing'}}
298 namespace bogus_keyword_suggestion
{
300 status
= "OK"; // expected-error-re {{use of undeclared identifier 'status'{{$}}}}
301 return status
; // expected-error-re {{use of undeclared identifier 'status'{{$}}}}
307 void CreateFoo(float, float);
308 void CreateBar(float, float);
311 using A::CreateFoo
; // expected-note {{'CreateFoo' declared here}}
312 void CreateFoo(int, int); // expected-note {{'CreateFoo' declared here}}
315 x
.Createfoo(0,0); // expected-error {{no member named 'Createfoo' in 'PR13387::B'; did you mean 'CreateFoo'?}}
316 x
.Createfoo(0.f
,0.f
); // expected-error {{no member named 'Createfoo' in 'PR13387::B'; did you mean 'CreateFoo'?}}
320 namespace using_decl
{
321 namespace somewhere
{ int foobar
; }
322 using somewhere::foobar
; // expected-note {{declared here}}
323 int k
= goobar
; // expected-error {{did you mean 'foobar'?}}
326 struct DataStruct
{void foo();};
328 DataStruct data_struct
;
331 // should be void T::f();
333 data_struct
->foo(); // expected-error-re{{use of undeclared identifier 'data_struct'{{$}}}}
340 void nab(); // expected-note{{'::PR12287::nab' declared here}}
342 nab(); // expected-error{{too few arguments to function call, expected 1, have 0; did you mean '::PR12287::nab'?}}
346 namespace TemplateFunction
{
348 void fnA(T
) { } // expected-note {{'::TemplateFunction::fnA' declared here}}
351 void fnB(T
) { } // expected-note {{'::TemplateFunction::fnB' declared here}}
355 void fnA(int, int) {}
359 void test(Foo F
, int num
) {
360 F
.fnA(num
); // expected-error {{too few arguments to function call, expected 2, have 1; did you mean '::TemplateFunction::fnA'?}}
361 F
.fnB(num
); // expected-error {{too many arguments to function call, expected 0, have 1; did you mean '::TemplateFunction::fnB'?}}
364 namespace using_suggestion_val_dropped_specifier
{
365 void FFF() {} // expected-note {{'::using_suggestion_val_dropped_specifier::FFF' declared here}}
367 using N::FFF
; // expected-error {{no member named 'FFF' in namespace 'using_suggestion_val_dropped_specifier::N'; did you mean '::using_suggestion_val_dropped_specifier::FFF'?}}
370 namespace class_member_typo_corrections
{
373 class Inner
{}; // expected-note {{'Outer::Inner' declared here}}
374 Inner
MyMethod(Inner arg
);
377 Inner
Outer::MyMethod(Inner arg
) { // expected-error {{unknown type name 'Inner'; did you mean 'Outer::Inner'?}}
384 ENTITY
, // expected-note {{'Result::ENTITY' declared here}}
385 PREDICATE
, // expected-note {{'Result::PREDICATE' declared here}}
386 LITERAL
// expected-note {{'Result::LITERAL' declared here}}
394 switch (result_cell
.type()) {
395 case ENTITY
: // expected-error {{use of undeclared identifier 'ENTITY'; did you mean 'Result::ENTITY'?}}
396 case LITERAL
: // expected-error {{use of undeclared identifier 'LITERAL'; did you mean 'Result::LITERAL'?}}
397 case PREDICAT
: // expected-error {{use of undeclared identifier 'PREDICAT'; did you mean 'Result::PREDICATE'?}}
415 switch (obj
.type()) {
416 case SQUARE
: // expected-error-re {{use of undeclared identifier 'SQUARE'{{$}}}}
417 case TRIANGLE
: // expected-error-re {{use of undeclared identifier 'TRIANGLE'{{$}}}}
418 case CIRCE
: // expected-error-re {{use of undeclared identifier 'CIRCE'{{$}}}}
424 long readline(const char *, char *, unsigned long);
425 void assign_to_unknown_var() {
426 deadline_
= 1; // expected-error-re {{use of undeclared identifier 'deadline_'{{$}}}}
429 namespace no_ns_before_dot
{
432 req
.set_check(false); // expected-error-re {{use of undeclared identifier 'req'{{$}}}}
441 class B
: private A
{};
442 B zzzzzzzzzy
<>; // expected-error {{template specialization requires 'template<>'}} expected-error {{no variable template matches specialization}}
445 namespace correct_fields_in_member_funcs
{
447 int my_member
; // expected-note {{'my_member' declared here}}
448 void f() { my_menber
= 1; } // expected-error {{use of undeclared identifier 'my_menber'; did you mean 'my_member'?}}
455 evil(F de
) { // expected-note {{'de' declared here}}
456 de_
; // expected-error {{use of undeclared identifier 'de_'; did you mean 'de'?}} \
457 // expected-warning {{expression result unused}}
460 de_
->bar() // expected-error {{use of undeclared identifier 'de_'}}
465 evil
<int> Q(0); // expected-note {{in instantiation of member function}}
469 namespace fix_class_name_qualifier
{
470 class MessageHeaders
{};
473 static void ParseMessageHeaders(int, int); // expected-note {{'MessageUtils::ParseMessageHeaders' declared here}}
477 // No, we didn't mean to call MessageHeaders::MessageHeaders.
478 MessageHeaders::ParseMessageHeaders(5, 4); // expected-error {{no member named 'ParseMessageHeaders' in 'fix_class_name_qualifier::MessageHeaders'; did you mean 'MessageUtils::ParseMessageHeaders'?}}
482 namespace PR18213
{ // expected-note {{'PR18213' declared here}}
487 template <typename T
> struct Wrappable
{
488 static WrapperInfo kWrapperInfo
;
491 // Note the space before "::PR18213" is intended and needed, as it highlights
492 // the actual typo, which is the leading "::".
493 // TODO: Suggest removing the "::" from "::PR18213" (the right correction)
494 // instead of incorrectly suggesting dropping "PR18213::WrapperInfo::".
496 PR18213::WrapperInfo ::PR18213::Wrappable
<int>::kWrapperInfo
= { 0 }; // expected-error {{no member named 'PR18213' in 'PR18213::WrapperInfo'; did you mean simply 'PR18213'?}} \
497 // expected-error {{a type specifier is required for all declarations}}
505 int y
= x
; // expected-error-re {{use of undeclared identifier 'x'{{$}}}}
509 template <class C
, int I
, int J
>
515 template <class C
, int I
>
516 class SmallSetVector
: public SetVector
<C
, I
, 8> {};
519 SmallSetVector
<foo
*, 2> fooSet
;
522 PR18685::BitVector Map
; // expected-error-re {{no type named 'BitVector' in namespace 'PR18685'{{$}}}}
524 namespace shadowed_template
{
525 template <typename T
> class Fizbin
{}; // expected-note {{'::shadowed_template::Fizbin' declared here}}
528 Fizbin
<int> qux
; // expected-error {{no template named 'Fizbin'; did you mean '::shadowed_template::Fizbin'?}}
532 namespace no_correct_template_id_to_non_template
{
533 struct Frobnatz
{}; // expected-note {{declared here}}
534 Frobnats fn
; // expected-error {{unknown type name 'Frobnats'; did you mean 'Frobnatz'?}}
535 Frobnats
<int> fni
; // expected-error-re {{no template named 'Frobnats'{{$}}}}
543 barberry(); // expected-error-re {{use of undeclared identifier 'barberry'{{$}}}}
549 static void Stop(); // expected-note {{'Thread::Stop' declared here}}
554 void Start(int); // expected-note {{'Start' declared here}}
555 void Stop(int); // expected-note {{'Stop' declared here}}
558 void test(Manager
*m
) {
559 // Don't suggest Thread::Start as a correction just because it has the same
560 // (unqualified) name and accepts the right number of args; this is a method
561 // call on an object in an unrelated class.
562 m
->Start(); // expected-error-re {{too few arguments to function call, expected 1, have 0{{$}}}}
563 m
->Stop(); // expected-error-re {{too few arguments to function call, expected 1, have 0{{$}}}}
564 Stop(); // expected-error {{use of undeclared identifier 'Stop'; did you mean 'Thread::Stop'?}}
570 class bernoulli_distribution
{
576 // Make sure that typo correction doesn't suggest changing 'p' to
577 // 'std::bernoulli_distribution::p' as that is most likely wrong.
578 if (p
) // expected-error-re {{use of undeclared identifier 'p'{{$}}}}
587 template<typename T
> void private_memfn(T
); // expected-note{{declared here}}
590 // FIXME: should suggest 'PR19681::TypoB::private_memfn' instead of '::PR19681::TypoB::private_memfn'
591 (void)static_cast<void(TypoB::*)(int)>(&TypoA::private_memfn
); // expected-error{{no member named 'private_memfn' in 'PR19681::TypoA'; did you mean '::PR19681::TypoB::private_memfn'?}}
595 namespace testWantFunctionLikeCasts
{
598 return struc(5.7); // expected-error-re {{use of undeclared identifier 'struc'{{$}}}}
600 return lon(8.0); // expected-error {{use of undeclared identifier 'lon'; did you mean 'long'?}}
604 namespace testCXXDeclarationSpecifierParsing
{
606 struct SomeSettings
{}; // expected-note {{'test::SomeSettings' declared here}}
610 Test::SomeSettings some_settings
; // expected-error {{no type named 'SomeSettings' in 'testCXXDeclarationSpecifierParsing::Test'; did you mean 'test::SomeSettings'?}}
614 namespace testIncludeTypeInTemplateArgument
{
615 template <typename T
, typename U
>
616 void foo(T t
= {}, U
= {}); // expected-note {{candidate template ignored}}
618 class AddObservation
{}; // expected-note {{declared here}}
620 // should resolve to a class.
621 foo
<AddObservationFn
, int>(); // expected-error {{unknown type name 'AddObservationFn'; did you mean 'AddObservation'?}}
623 // should not resolve to a class.
624 foo(AddObservationFn
, 1); // expected-error-re {{use of undeclared identifier 'AddObservationFn'{{$}}}}
625 int a
= AddObservationFn
, b
; // expected-error-re {{use of undeclared identifier 'AddObservationFn'{{$}}}}
627 int AddObservation
; // expected-note 3{{declared here}}
628 // should resolve to a local variable.
629 foo(AddObservationFn
, 1); // expected-error {{use of undeclared identifier 'AddObservationFn'; did you mean}}
630 int c
= AddObservationFn
, d
; // expected-error {{use of undeclared identifier 'AddObservationFn'; did you mean}}
632 // FIXME: would be nice to not resolve to a variable.
633 foo
<AddObservationFn
, int>(); // expected-error {{use of undeclared identifier 'AddObservationFn'; did you mean}} \
634 expected
-error
{{no matching function
for call
}}
636 } // namespace testIncludeTypeInTemplateArgument
638 namespace testNoCrashOnNullNNSTypoCorrection
{
639 int AddObservation();
640 template <typename T
, typename
... Args
>
642 class AddObservation
{ // expected-note {{declared here}}
644 // should resolve to a class.
645 UsingImpl
<AddObservationFn
, const int>; // expected-error {{unknown type name 'AddObservationFn'; did you mean}}
647 } // namespace testNoCrashOnNullNNSTypoCorrection
649 namespace testNonStaticMemberHandling
{
651 bool usesMetadata
; // expected-note {{'usesMetadata' declared here}}
654 if (UsesMetadata
) // expected-error-re {{use of undeclared identifier 'UsesMetadata'{{$}}}}
656 if (f
.UsesMetadata
) // expected-error {{no member named 'UsesMetadata' in 'testNonStaticMemberHandling::Foo'; did you mean 'usesMetadata'?}}
662 namespace testMemberExprDeclarationNameInfo
{
663 // The AST should only have the corrected name with no mention of 'data_'.
666 int data
; // expected-note 2{{'data' declared here}}
668 data_
// expected-error {{use of undeclared identifier 'data_'}}
669 [] = // expected-error {{expected expression}}
670 f(data_
); // expected-error {{use of undeclared identifier 'data_'}}
675 namespace testArraySubscriptIndex
{
677 int data
; // expected-note {{'data' declared here}}
679 (+)[data_
]; // expected-error{{expected expression}} expected-error {{use of undeclared identifier 'data_'; did you mean 'data'}}
684 namespace crash_has_include
{
685 int has_include(int); // expected-note {{'has_include' declared here}}
686 // expected-error@+1 {{'__has_include' must be used within a preprocessing directive}}
687 int foo
= __has_include(42); // expected-error {{use of undeclared identifier '__has_include'; did you mean 'has_include'?}}
690 namespace PR24781_using_crash
{
693 class Foofoo
{}; // expected-note {{'A::B::Foofoo' declared here}}
699 class Bar
: public A::B::Foofoo
{};
703 using C::D::Foofoo
; // expected-error {{no member named 'Foofoo' in namespace 'PR24781_using_crash::C::D'; did you mean 'A::B::Foofoo'?}}
706 int d
= ? L
: d
; // expected-error {{expected expression}} expected-error {{undeclared identifier}}
709 int : 0 | // expected-error {{invalid operands to binary expression}}
710 (struct B0
)e
; // expected-error {{use of undeclared identifier}}
718 sizeof(c0is0
)]; // expected-error {{use of undeclared identifier}}
722 namespace avoidRedundantRedefinitionErrors
{
724 void function(int pid
); // expected-note {{'function' declared here}}
727 void Class::function2(int pid
) { // expected-error {{out-of-line definition of 'function2' does not match any declaration in 'avoidRedundantRedefinitionErrors::Class'; did you mean 'function'?}}
730 // Expected no redefinition error here.
731 void Class::function(int pid
) { // expected-note {{previous definition is here}}
734 void Class::function(int pid
) { // expected-error {{redefinition of 'function'}}
738 void create_test(); // expected-note {{'create_test' declared here}}
741 void ns::create_test2() { // expected-error {{out-of-line definition of 'create_test2' does not match any declaration in namespace 'avoidRedundantRedefinitionErrors::ns'; did you mean 'create_test'?}}
744 // Expected no redefinition error here.
745 void ns::create_test() {
750 bool g_var_bool
; // expected-note {{here}}
751 const char g_volatile_char
= 5; // expected-note {{here}}
752 // FIXME: We shouldn't suggest a typo-correction to 'g_var_bool' here,
753 // because it doesn't make the expression valid.
754 // expected-error@+2 {{did you mean 'g_var_bool'}}
755 // expected-error@+1 {{assigning to 'bool' from incompatible type 'void'}}
756 enum : typename
decltype((g_var_long
= throw))::a
{
757 b
= g_volatile_uchar
// expected-error {{did you mean 'g_volatile_char'}}
765 int Take(); // expected-note{{'Views::Take' declared here}}
768 namespace [[deprecated("use Views instead")]] View
{
772 namespace [[deprecated
]] A
{ // expected-note{{'A' has been explicitly marked deprecated here}}
777 using A::pr47272
; // expected-note{{'B::pr47272' declared here}} expected-warning{{'A' is deprecated}}
780 namespace [[deprecated
]] C
{
785 int x
= ::Take(); // expected-error{{no member named 'Take' in the global namespace; did you mean 'Views::Take'?}}
786 int y
= ::pr47272
; // expected-error{{no member named 'pr47272' in the global namespace; did you mean 'B::pr47272'?}}