diff options
author | Mark Mitchell <mark@codesourcery.com> | 2003-10-02 23:14:01 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2003-10-02 23:14:01 +0000 |
commit | c8a65a25634c802d0de7ab33beba49c97eb5d196 (patch) | |
tree | 649eeb261c183570f38ba1c4b7c4e8bf1627b528 /gcc/cp | |
parent | bb1b12ec0af7cba621fe5c1b516b1fc34c623b07 (diff) | |
download | gcc-c8a65a25634c802d0de7ab33beba49c97eb5d196.zip gcc-c8a65a25634c802d0de7ab33beba49c97eb5d196.tar.gz gcc-c8a65a25634c802d0de7ab33beba49c97eb5d196.tar.bz2 |
re PR c++/12486 (Accepts IMHO invalid C++ code)
PR c++/12486
* typeck.c (finish_class_member_access_expr): Issue diagnostic
on erroneous use of qualified name.
PR c++/12486
* g++.dg/inherit/error1.C: New test.
From-SVN: r72052
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 7 |
2 files changed, 12 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index b6fe158..1661e41 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2003-10-02 Mark Mitchell <mark@codesourcery.com> + + PR c++/12486 + * typeck.c (finish_class_member_access_expr): Issue diagnostic + on erroneous use of qualified name. + 2003-09-30 Richard Henderson <rth@redhat.com> * decl.c (duplicate_decls): Copy DECL_SAVED_INSNS too. diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 5c45976..25d6ac4 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -1888,8 +1888,13 @@ finish_class_member_access_expr (tree object, tree name) /* Find the base of OBJECT_TYPE corresponding to SCOPE. */ access_path = lookup_base (object_type, scope, ba_check, NULL); - if (!access_path || access_path == error_mark_node) + if (access_path == error_mark_node) return error_mark_node; + if (!access_path) + { + error ("`%T' is not a base of `%T'", scope, object_type); + return error_mark_node; + } } else { |