1// RUN: %clang_cc1 -fsyntax-only -verify %s
2// RUN: cp %s %t
3// RUN: not %clang_cc1 -fsyntax-only -fixit -x c++ %t
4// RUN: %clang_cc1 -fsyntax-only -pedantic -Werror -x c++ %t
5// RUN: grep using_suggestion_tyname_ty_dropped_specifier %t
6
7// These tests have been separated from typo.cpp to keep the maximum typo
8// correction counter from ticking over; this causes spurious failures.
9
10namespace using_suggestion_ty {
11namespace N { class AAA {}; } // expected-note {{'AAA' declared here}}
12using N::AAB; // expected-error {{no member named 'AAB' in namespace 'using_suggestion_ty::N'; did you mean 'AAA'?}}
13}
14
15namespace using_suggestion_tyname_ty {
16namespace N { class AAA {}; } // expected-note {{'AAA' declared here}}
17using typename N::AAB; // expected-error {{no member named 'AAB' in namespace 'using_suggestion_tyname_ty::N'; did you mean 'AAA'?}}
18}
19
20namespace using_suggestion_val {
21namespace N { void FFF() {} } // expected-note {{'FFF' declared here}}
22using N::FFG; // expected-error {{no member named 'FFG' in namespace 'using_suggestion_val::N'; did you mean 'FFF'?}}
23}
24
25namespace using_suggestion_ty_dropped_specifier {
26class AAA {}; // expected-note {{'::using_suggestion_ty_dropped_specifier::AAA' declared here}}
27namespace N { }
28using N::AAA; // expected-error {{no member named 'AAA' in namespace 'using_suggestion_ty_dropped_specifier::N'; did you mean '::using_suggestion_ty_dropped_specifier::AAA'?}}
29}
30
31namespace using_suggestion_tyname_ty_dropped_specifier {
32class AAA {}; // expected-note {{'::using_suggestion_tyname_ty_dropped_specifier::AAA' declared here}}
33namespace N { }
34using typename N::AAA; // expected-error {{no member named 'AAA' in namespace 'using_suggestion_tyname_ty_dropped_specifier::N'; did you mean '::using_suggestion_tyname_ty_dropped_specifier::AAA'?}}
35}
36
37namespace using_suggestion_val_dropped_specifier {
38void FFF() {} // expected-note {{'::using_suggestion_val_dropped_specifier::FFF' declared here}}
39namespace N { }
40using 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'?}}
41}
42
43namespace using_suggestion_member_ty {
44class CCC { public: typedef int AAA; }; // expected-note {{'AAA' declared here}}
45class DDD : public CCC { public: using CCC::AAB; }; // expected-error {{no member named 'AAB' in 'using_suggestion_member_ty::CCC'; did you mean 'AAA'?}}
46}
47
48namespace using_suggestion_member_val {
49class CCC { public: void AAA() { } }; // expected-note {{'AAA' declared here}}
50class DDD : public CCC { public: using CCC::AAB; }; // expected-error {{no member named 'AAB' in 'using_suggestion_member_val::CCC'; did you mean 'AAA'?}}
51}
52
53namespace using_suggestion_member_tyname_ty {
54class CCC { public: typedef int AAA; }; // expected-note {{'AAA' declared here}}
55class DDD : public CCC { public: using typename CCC::AAB; }; // expected-error {{no member named 'AAB' in 'using_suggestion_member_tyname_ty::CCC'; did you mean 'AAA'?}}
56}
57