summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/SemaCXX/qual-id-test.cpp26
-rw-r--r--test/SemaTemplate/member-access-expr.cpp8
2 files changed, 21 insertions, 13 deletions
diff --git a/test/SemaCXX/qual-id-test.cpp b/test/SemaCXX/qual-id-test.cpp
index 9032d0e956..ecb6aa9b35 100644
--- a/test/SemaCXX/qual-id-test.cpp
+++ b/test/SemaCXX/qual-id-test.cpp
@@ -107,18 +107,26 @@ namespace C
a.A::B::base::x();
a->A::member::foo();
- a.bad::x(); // xpected-error{{direct or virtual}}
- a.sub::x();
- a.base::x();
- a.B::base::x(); // xpected-error{{use of undeclared identifier 'B'}}
- a->member::foo();
+ a.bad::x(); // expected-error{{direct or virtual}}
}
-
+
void test_fun5() {
- // FIXME: Enable the following once we get the nested-name-specifier lookup
- // right during template instantiation.
- // fun5<A::sub>(); // xpected-note 2{{instantiation}}
+ fun5<A::sub>(); // expected-note{{instantiation}}
}
+
+ template<typename T>
+ void fun6() {
+ T a;
+ a.sub::x();
+ a.base::x();
+ a->member::foo();
+ a.B::base::x(); // expected-error{{use of undeclared identifier 'B'}}
+ }
+
+ void test_fun6() {
+ fun6<A::sub>(); // expected-note{{instantiation}}
+ }
+
}
// PR4703
diff --git a/test/SemaTemplate/member-access-expr.cpp b/test/SemaTemplate/member-access-expr.cpp
index f41dc2120a..408e2bb53c 100644
--- a/test/SemaTemplate/member-access-expr.cpp
+++ b/test/SemaTemplate/member-access-expr.cpp
@@ -1,5 +1,4 @@
// RUN: clang-cc -fsyntax-only -verify %s
-// XFAIL
template<typename T>
void call_f0(T x) {
x.Base::f0();
@@ -30,7 +29,8 @@ void test_f0_through_typedef(X0 x0) {
template<typename TheBase, typename T>
void call_f0_through_typedef2(T x) {
typedef TheBase CrazyBase; // expected-note{{current scope}}
- x.CrazyBase::f0(); // expected-error{{ambiguous}}
+ x.CrazyBase::f0(); // expected-error{{ambiguous}} \
+ // expected-error 2{{no member named}}
}
struct OtherBase { };
@@ -41,8 +41,8 @@ struct X1 : Base, OtherBase {
void test_f0_through_typedef2(X0 x0, X1 x1) {
call_f0_through_typedef2<Base>(x0);
- call_f0_through_typedef2<OtherBase>(x1);
- call_f0_through_typedef2<Base>(x1); // expected-note{{here}}
+ call_f0_through_typedef2<OtherBase>(x1); // expected-note{{instantiation}}
+ call_f0_through_typedef2<Base>(x1); // expected-note{{instantiation}}
}