summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/using-decl-1.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2014-04-30 18:15:00 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2014-04-30 18:15:00 +0000
commitd94f2f16bd2359595bd17f4e759de8569a94cd60 (patch)
tree8ea2eb9000df2b155a0ef853f2863a4b21e8e380 /clang/test/SemaCXX/using-decl-1.cpp
parent21866c3267a258c928f6c00be9004468a569bd84 (diff)
downloadbcm5719-llvm-d94f2f16bd2359595bd17f4e759de8569a94cd60.tar.gz
bcm5719-llvm-d94f2f16bd2359595bd17f4e759de8569a94cd60.zip
When typo-correcting a member using declaration, don't exclude member templates.
llvm-svn: 207681
Diffstat (limited to 'clang/test/SemaCXX/using-decl-1.cpp')
-rw-r--r--clang/test/SemaCXX/using-decl-1.cpp59
1 files changed, 35 insertions, 24 deletions
diff --git a/clang/test/SemaCXX/using-decl-1.cpp b/clang/test/SemaCXX/using-decl-1.cpp
index 2ce0b109086..a91d20b0f32 100644
--- a/clang/test/SemaCXX/using-decl-1.cpp
+++ b/clang/test/SemaCXX/using-decl-1.cpp
@@ -195,32 +195,43 @@ namespace UsingDeclVsHiddenName {
}
}
-struct Z {
- Z();
-};
+namespace PR19171 {
+ struct Z {
+ Z();
+ };
-typedef struct {
- Z i;
-} S;
+ typedef struct {
+ Z i;
+ } S;
-struct Y : S {
- using S::S; // expected-error {{no member named 'S' in 'S'}}
-};
+ struct Y : S {
+ using S::S; // expected-error {{no member named 'S' in 'PR19171::S'}}
+ };
-// [namespace.udecl]p3: In a using-declaration used as a member-declaration,
-// the nested-name-specifier shall name a base class of the class being defined.
-// If such a using-declaration names a constructor, the nested-name-specifier
-// shall name a direct base class of the class being defined;
+ // [namespace.udecl]p3: In a using-declaration used as a member-declaration,
+ // the nested-name-specifier shall name a base class of the class being defined.
+ // If such a using-declaration names a constructor, the nested-name-specifier
+ // shall name a direct base class of the class being defined;
-// FIXME: For c++11, Typo correction should only consider constructor of direct base class
-struct PR19171_B { }; // expected-note {{'PR19171_B' declared here}}
-struct PR19171_C : PR19171_B { };
-struct PR19171_D : PR19171_C {
- using PR19171_B::PR19171_C; // expected-error{{no member named 'PR19171_C' in 'PR19171_B'; did you mean 'PR19171_B'?}}
-};
+ // FIXME: For c++11, Typo correction should only consider constructor of direct base class
+ struct B_blah { }; // expected-note {{'B_blah' declared here}}
+ struct C_blah : B_blah { };
+ struct D : C_blah {
+ using B_blah::C_blah; // expected-error {{no member named 'C_blah' in 'PR19171::B_blah'; did you mean 'B_blah'?}}
+ };
-struct PR19171_E { };
-struct PR19171_EE { int EE; };
-struct PR19171_F : PR19171_E {
- using PR19171_E::EE; // expected-error-re{{no member named 'EE' in 'PR19171_E'{{$}}}}
-};
+ struct E { };
+ struct EE { int EE; };
+ struct F : E {
+ using E::EE; // expected-error-re {{no member named 'EE' in 'PR19171::E'{{$}}}}
+ };
+}
+
+namespace TypoCorrectTemplateMember {
+ struct A {
+ template<typename T> void foobar(T); // expected-note {{'foobar' declared here}}
+ };
+ struct B : A {
+ using A::goobar; // expected-error {{no member named 'goobar' in 'TypoCorrectTemplateMember::A'; did you mean 'foobar'?}}
+ };
+}
OpenPOWER on IntegriCloud