C++: Fix crash in warn_for_memset within templates (PR c++/83814)
authorDavid Malcolm <dmalcolm@redhat.com>
Wed, 17 Jan 2018 17:51:25 +0000 (17:51 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Wed, 17 Jan 2018 17:51:25 +0000 (17:51 +0000)
commitbb9869d5a3e3a0f3673742ede7ea9bc325adbb4a
tree4ad7e64ad7b745b5bef09ce376f20f5235b2d803
parentd2edcd7083601bc08789787331399624b85b843b
C++: Fix crash in warn_for_memset within templates (PR c++/83814)

gcc/c-family/ChangeLog:
PR c++/83814
* c-common.c (fold_for_warn): Move to c/c-fold.c and cp/expr.c.

gcc/c/ChangeLog:
PR c++/83814
* c-fold.c (fold_for_warn): Move from c-common.c, reducing to just
the C part.

gcc/cp/ChangeLog:
PR c++/83814
* expr.c (fold_for_warn): Move from c-common.c, reducing to just
the C++ part.  If processing a template, call
fold_non_dependent_expr rather than fully folding.

gcc/testsuite/ChangeLog:
PR c++/83814
PR c++/83902
* g++.dg/wrappers/pr83814.C: New test case.
* g++.dg/wrappers/pr83902.C: New test case.

From-SVN: r256804
gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/c/ChangeLog
gcc/c/c-fold.c
gcc/cp/ChangeLog
gcc/cp/expr.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/wrappers/pr83814.C [new file with mode: 0644]
gcc/testsuite/g++.dg/wrappers/pr83902.C [new file with mode: 0644]