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 ABC {}; // expected-note {{'::using_suggestion_ty_dropped_specifier::ABC' declared here}}
27namespace N { }
28using N::ABC; // expected-error {{no member named 'ABC' in namespace 'using_suggestion_ty_dropped_specifier::N'; did you mean '::using_suggestion_ty_dropped_specifier::ABC'?}}
29}
30
31namespace using_suggestion_tyname_ty_dropped_specifier {
32class BCD {}; // expected-note {{'::using_suggestion_tyname_ty_dropped_specifier::BCD' declared here}}
33namespace N { }
34using typename N::BCD; // expected-error {{no member named 'BCD' in namespace 'using_suggestion_tyname_ty_dropped_specifier::N'; did you mean '::using_suggestion_tyname_ty_dropped_specifier::BCD'?}}
35}
36
37namespace using_suggestion_val_dropped_specifier {
38void EFG() {} // expected-note {{'::using_suggestion_val_dropped_specifier::EFG' declared here}}
39namespace N { }
40using N::EFG; // expected-error {{no member named 'EFG' in namespace 'using_suggestion_val_dropped_specifier::N'; did you mean '::using_suggestion_val_dropped_specifier::EFG'?}}
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