C++: Fix ICE in fold_for_warn on CAST_EXPR (PR c++/83974)

gcc/cp/ChangeLog:
	PR c++/83974
	* pt.c (tsubst_copy_and_build) <CONSTRUCTOR>: Remove early bailout
	for pointer to member function types.

gcc/testsuite/ChangeLog:
	PR c++/83974
	* g++.dg/warn/pr83974.C: New test case.

From-SVN: r256999
This commit is contained in:
David Malcolm 2018-01-23 21:19:09 +00:00 committed by David Malcolm
parent 508d0c3da2
commit 7c719d0849
4 changed files with 22 additions and 4 deletions

View File

@ -1,3 +1,9 @@
2018-01-23 David Malcolm <dmalcolm@redhat.com>
PR c++/83974
* pt.c (tsubst_copy_and_build) <CONSTRUCTOR>: Remove early bailout
for pointer to member function types.
2018-01-23 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/83987

View File

@ -18097,10 +18097,6 @@ tsubst_copy_and_build (tree t,
if (type == error_mark_node)
RETURN (error_mark_node);
/* digest_init will do the wrong thing if we let it. */
if (type && TYPE_PTRMEMFUNC_P (type))
RETURN (t);
/* We do not want to process the index of aggregate
initializers as they are identifier nodes which will be
looked up by digest_init. */

View File

@ -1,3 +1,8 @@
2018-01-23 David Malcolm <dmalcolm@redhat.com>
PR c++/83974
* g++.dg/warn/pr83974.C: New test case.
2018-01-23 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/83987

View File

@ -0,0 +1,11 @@
// { dg-options "-Wtautological-compare" }
struct A {
typedef void (A::*B) ();
operator B ();
};
template <typename>
struct C {
void foo () { d == 0; }
A d;
};