[PATCH] Fix PR C++/38648 ICE with string literal

Andrew Pinski pinskia@gmail.com
Wed Dec 31 02:03:00 GMT 2008


Hi,
  The problem here is that in some cases while defining a function
current_function_decl is NULL. We would ICE when checking to see if
the function is an compiler generated one or not for while seeing if
we could generate an assignment to an array.

This patch fixes the problem by checking to see if
current_function_decl is NULL.

OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.

Thanks,
Andrew Pinski

ChangeLog:
* typeck.c (cp_build_modify_expr): Check for NULL current_function_decl.

* g++.dg/expr/string-1.C: New test.
* g++.dg/expr/string-2.C: New test.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: fix38648.diff.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20081231/a6f6cb95/attachment.txt>


More information about the Gcc-patches mailing list