This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Fix PR c++/29363


Lee Millward wrote:

> cp/
> 2006-10-18 Lee Millward <lee.millward@codesourcery.com>
>
> PR c++/29363
> * lex.c (unqualified_fn_lookup_error): Return error_mark_node
> rather than the broken identifier if no declaration for it is available.

Index: gcc/cp/lex.c
===================================================================
--- gcc/cp/lex.c (revision 117837)
+++ gcc/cp/lex.c (working copy)
@@ -653,7 +653,7 @@ unqualified_fn_lookup_error (tree name)
hint = true;
}
}
- return name;
+ return error_mark_node;
}
return unqualified_name_lookup_error (name);

Unfortunately, I think this will not work correctly in the case of -fpermissive, since in that case the code above this point will have issued a pedwarn, but that will just be a warning, not an error. So, I bet this case:


  template <typename>
  void f() {
    return g();
  }

would be mishandled by your patch, when compiled with -fpermissive.

So, sadly, I think we need to find some other solution...

--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]