Commit 444762df by Jason Merrill Committed by Jason Merrill

re PR c++/18698 (Error message using "using" for code not using "using" ;-))

        PR c++/18698
        * decl2.c (grokfield): Only try to treat the decl as an access
        declaration if the scope is a class.

From-SVN: r115095
parent 1d737af9
2006-06-30 Jason Merrill <jason@redhat.com>
PR c++/18698
* decl2.c (grokfield): Only try to treat the decl as an access
declaration if the scope is a class.
2006-06-29 Jason Merrill <jason@redhat.com> 2006-06-29 Jason Merrill <jason@redhat.com>
PR c++/26905 PR c++/26905
......
...@@ -769,6 +769,8 @@ grokfield (const cp_declarator *declarator, ...@@ -769,6 +769,8 @@ grokfield (const cp_declarator *declarator,
if (!declspecs->any_specifiers_p if (!declspecs->any_specifiers_p
&& declarator->kind == cdk_id && declarator->kind == cdk_id
&& declarator->u.id.qualifying_scope && declarator->u.id.qualifying_scope
&& TYPE_P (declarator->u.id.qualifying_scope)
&& IS_AGGR_TYPE (declarator->u.id.qualifying_scope)
&& TREE_CODE (declarator->u.id.unqualified_name) == IDENTIFIER_NODE) && TREE_CODE (declarator->u.id.unqualified_name) == IDENTIFIER_NODE)
/* Access declaration */ /* Access declaration */
return do_class_using_decl (declarator->u.id.qualifying_scope, return do_class_using_decl (declarator->u.id.qualifying_scope,
......
// PR c++/18698
// The compiler was giving an error message for invalid syntax
// that irrelevantly talked about using-declarations.
template<int> struct A
{
::A~(); // { dg-bogus "using-declaration" }
};
// Instead of the bogus error we get 3 separate errors.
// { dg-error "no type" "" { target *-*-* } 5 }
// { dg-error "::" "" { target *-*-* } 5 }
// { dg-error "~" "" { target *-*-* } 5 }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment