http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57041



--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> 2013-04-23 
10:06:37 UTC ---

lookup_field_1 instead of IDENTIFIER_NODE gets the error_mark_node, and the

following assert chokes on it:

  gcc_assert (identifier_p (name));



It seems that if we just return NULL_TREE in that case, everything is fine.



--- a/gcc/cp/search.c

+++ b/gcc/cp/search.c

@@ -381,7 +381,7 @@ lookup_field_1 (tree type, tree name, bool want_type)

 {

   tree field;



-  gcc_assert (identifier_p (name));

+  gcc_assert (identifier_p (name) || name == error_mark_node);



   if (TREE_CODE (type) == TEMPLATE_TYPE_PARM

       || TREE_CODE (type) == BOUND_TEMPLATE_TEMPLATE_PARM

Reply via email to