diff options
Diffstat (limited to 'test/SemaCXX/member-expr.cpp')
-rw-r--r-- | test/SemaCXX/member-expr.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/test/SemaCXX/member-expr.cpp b/test/SemaCXX/member-expr.cpp index 13ff64d..54a9593 100644 --- a/test/SemaCXX/member-expr.cpp +++ b/test/SemaCXX/member-expr.cpp @@ -2,7 +2,7 @@ class X{ public: - enum E {Enumerator}; + enum E {Enumerator}; // expected-note 2{{declared here}} int f(); static int mem; static float g(); @@ -11,8 +11,8 @@ public: void test(X* xp, X x) { int i1 = x.f(); int i2 = xp->f(); - x.E; // expected-error{{cannot refer to type member 'E' with '.'}} - xp->E; // expected-error{{cannot refer to type member 'E' with '->'}} + x.E; // expected-error{{cannot refer to type member 'E' in 'X' with '.'}} + xp->E; // expected-error{{cannot refer to type member 'E' in 'X' with '->'}} int i3 = x.Enumerator; int i4 = xp->Enumerator; x.mem = 1; @@ -56,3 +56,19 @@ namespace test3 { } }; } + +namespace test4 { + class X { + protected: + template<typename T> void f(T); + }; + + class Y : public X { + public: + using X::f; + }; + + void test_f(Y y) { + y.f(17); + } +} |