Home | History | Annotate | Download | only in FixIt
      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 
     10 namespace using_suggestion_ty {
     11 namespace N { class AAA {}; } // expected-note {{'AAA' declared here}}
     12 using N::AAB; // expected-error {{no member named 'AAB' in namespace 'using_suggestion_ty::N'; did you mean 'AAA'?}}
     13 }
     14 
     15 namespace using_suggestion_tyname_ty {
     16 namespace N { class AAA {}; } // expected-note {{'AAA' declared here}}
     17 using typename N::AAB; // expected-error {{no member named 'AAB' in namespace 'using_suggestion_tyname_ty::N'; did you mean 'AAA'?}}
     18 }
     19 
     20 namespace using_suggestion_val {
     21 namespace N { void FFF() {} } // expected-note {{'FFF' declared here}}
     22 using N::FFG; // expected-error {{no member named 'FFG' in namespace 'using_suggestion_val::N'; did you mean 'FFF'?}}
     23 }
     24 
     25 namespace using_suggestion_ty_dropped_specifier {
     26 class ABC {}; // expected-note {{'::using_suggestion_ty_dropped_specifier::ABC' declared here}}
     27 namespace N { }
     28 using 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 
     31 namespace using_suggestion_tyname_ty_dropped_specifier {
     32 class BCD {}; // expected-note {{'::using_suggestion_tyname_ty_dropped_specifier::BCD' declared here}}
     33 namespace N { }
     34 using 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 
     37 namespace using_suggestion_val_dropped_specifier {
     38 void EFG() {} // expected-note {{'::using_suggestion_val_dropped_specifier::EFG' declared here}}
     39 namespace N { }
     40 using 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 
     43 namespace using_suggestion_member_ty {
     44 class CCC { public: typedef int AAA; }; // expected-note {{'AAA' declared here}}
     45 class 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 
     48 namespace using_suggestion_member_val {
     49 class CCC { public: void AAA() { } }; // expected-note {{'AAA' declared here}}
     50 class 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 
     53 namespace using_suggestion_member_tyname_ty {
     54 class CCC { public: typedef int AAA; }; // expected-note {{'AAA' declared here}}
     55 class 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