diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-09-03 21:38:09 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-09-03 21:38:09 +0000 |
commit | c68afe2cbe7f875a9243c411077602fb5f5dc74b (patch) | |
tree | 04412391650d20f0e45473601ed7d5f5ad8fe44e /test/SemaCXX | |
parent | 9d436205be3e4c05854530134be61b46b13136ff (diff) | |
download | clang-c68afe2cbe7f875a9243c411077602fb5f5dc74b.tar.gz |
Improve template instantiation for member access expressions that
involve qualified names, e.g., x->Base::f. We now maintain enough
information in the AST to compare the results of the name lookup of
"Base" in the scope of the postfix-expression (determined at template
definition time) and in the type of the object expression.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80953 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX')
-rw-r--r-- | test/SemaCXX/qual-id-test.cpp | 26 |
1 files changed, 17 insertions, 9 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 |