summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2003-02-12 20:02:40 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2003-02-12 20:02:40 +0000
commit91b4f20fa92d7e3cd72155b908aabb86dbc34789 (patch)
tree3cb1ea735d2369149cdbd3b2430f48978d01e3cd
parent25dc5de79662a4a855cb2e3f9f3a11a6bf664b40 (diff)
downloadgcc-91b4f20fa92d7e3cd72155b908aabb86dbc34789.tar.gz
* parser.c (cp_parser_postfix_expression): Set idk properly for
object->scope::member. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@62784 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/testsuite/g++.dg/overload/virtual1.C21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/overload/virtual1.C b/gcc/testsuite/g++.dg/overload/virtual1.C
new file mode 100644
index 00000000000..8940aefd053
--- /dev/null
+++ b/gcc/testsuite/g++.dg/overload/virtual1.C
@@ -0,0 +1,21 @@
+// Test that explicit scope suprresses virtual lookup even after an
+// explicit object.
+
+extern "C" int printf (const char *, ...);
+
+struct A
+{
+ virtual int f () { return 0; }
+};
+
+struct B: public A
+{
+ int f () { return 1; }
+ int g() { return this->A::f(); }
+};
+
+int main()
+{
+ B b;
+ return b.g();
+}