c++: Avoid ICE when constant evaluation of __builtin_strchr fails.
authorJason Merrill <jason@redhat.com>
Thu, 23 Jan 2020 17:43:15 +0000 (12:43 -0500)
committerJason Merrill <jason@redhat.com>
Thu, 23 Jan 2020 18:11:10 +0000 (13:11 -0500)
commit6f346913f2a87e26c6095d9fbf3d20f926c5470a
tree9825df53d5952050b7aa4d91917ca99362e93ebc
parent20afdcd36982752ba012960b862e9be7154b1274
c++: Avoid ICE when constant evaluation of __builtin_strchr fails.

If we can't change the argument to &"...", use the original arg instead of
the partially munged one.

PR c++/93331 - ICE with __builtin_strchr.
* constexpr.c (cxx_eval_builtin_function_call): Use the original
argument if we didn't manage to extract a STRING_CST.
gcc/cp/ChangeLog
gcc/cp/constexpr.c
gcc/testsuite/c-c++-common/pr34029-1.c [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/compile/pr34029-1.c [deleted file]