Bug 83974 - [8 Regression] ICE in cxx_eval_constant_expression
Summary: [8 Regression] ICE in cxx_eval_constant_expression
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 8.0
: P1 normal
Target Milestone: 8.0
Assignee: David Malcolm
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-22 18:07 UTC by Jakub Jelinek
Modified: 2018-01-23 21:20 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2018-01-22 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jakub Jelinek 2018-01-22 18:07:08 UTC
struct A {
  typedef void (A::*B) ();
  operator B ();
};
template <typename>
struct C {
  void foo () { d == 0; }
  A d;
};

ICEs on the trunk, likely starting with r256804.
Either constexpr.c needs to be taught to handle various processing_template_decl only tree codes, or we should have caught it earlier, like somewhere in is_nondependent_constant_expression or functions it calls.
Comment 1 Jakub Jelinek 2018-01-22 18:08:27 UTC
I should note that it ICEs only with -Wall or -Wtautological-compare.
Comment 2 David Malcolm 2018-01-22 21:48:43 UTC
Am testing a fix for this.
Comment 3 David Malcolm 2018-01-23 14:24:58 UTC
Candidate patch:
  https://gcc.gnu.org/ml/gcc-patches/2018-01/msg01955.html
Comment 4 David Malcolm 2018-01-23 21:19:41 UTC
Author: dmalcolm
Date: Tue Jan 23 21:19:09 2018
New Revision: 256999

URL: https://gcc.gnu.org/viewcvs?rev=256999&root=gcc&view=rev
Log:
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.


Added:
    trunk/gcc/testsuite/g++.dg/warn/pr83974.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/pt.c
    trunk/gcc/testsuite/ChangeLog
Comment 5 David Malcolm 2018-01-23 21:20:21 UTC
Should be fixed by r256999.