Commit 18ff35c6 by Lee Millward Committed by Lee Millward

re PR c++/26269 (Declaring a variable too late yields bogus error message)

        PR c++/26269
        * decl.c (duplicate_decls): Return early if either
        newdecl or olddecl is error_mark_node.

        * g++.dg/other/error14.C: New test.

From-SVN: r116301
parent 85d89e76
2006-08-21 Lee Millward <lee.millward@codesourcery.com>
PR c++/26269
* decl.c (duplicate_decls): Return early if either
newdecl or olddecl is error_mark_node.
2006-08-20 Mark Mitchell <mark@codesourcery.com>
PR c++/28341
......
......@@ -1124,7 +1124,7 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
about the same declaration, so just pretend the types match here. */
if (TREE_TYPE (newdecl) == error_mark_node
|| TREE_TYPE (olddecl) == error_mark_node)
types_match = 1;
return error_mark_node.
if (DECL_P (olddecl)
&& TREE_CODE (newdecl) == FUNCTION_DECL
......
2006-08-21 Lee Millward <lee.millward@codesourcery.com>
PR c++/26269
* g++.dg/other/error14.C: New test.
2006-08-21 Olivier Hainque <hainque@adacore.com>
* gnat.dg/self_aggregate_with_zeros.adb: New test.
//PR c++/26269
void foo()
{
i; // { dg-error "not declared in this scope" }
int i;
}
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