Hello, the code I will attacch shortly is a (partial) reduction from a multi-thousands line testcase from Boost which fails with 4.0. This is the link to the failure in the automatic testers: http://ln-s.net/2$N
Created attachment 7845 [details] Reduced testcase (but not minimal)
A regression from what? Does 3.4 accept it?
3.4 is broken too, it's a regression from 3.3 actually.
Reduced testcase: template <class C> struct if_t { typedef int type; }; template <class T> struct ffff { static const bool value = true; }; template <class A> struct bound_member_action { typedef char f[ffff<A>::value ? 1 : 2]; template <class CT> bound_member_action(CT i, typename if_t<f>::type g) {} }; bound_member_action<int> a(0, 1); : Search converges between 2004-01-27-trunk (#442) and 2004-01-28-trunk (#443). Just a note that date is when it started to seg fault. We started to reject this (and not an ICE): : Search converges between 2004-03-01-3.4 (#2) and 2004-03-15-3.4 (#3). : Search converges between 2004-03-01-trunk (#446) and 2004-04-01-trunk (#447).
Please add 3.4.2 to known to fail list. 7.Code:test> g++ -c bound_member.cpp bound_member.cpp: In instantiation of `bound_member_action<int>': bound_member.cpp:10: instantiated from here bound_member.cpp:8: error: `char[(ffff<int>::value ? 1 : 2)]' is a variably modified type bound_member.cpp:8: error: trying to instantiate `template<class C> struct if_t' bound_member.cpp:10: error: no matching function for call to `bound_member_action<int>::bound_member_action(int, int)' bound_member.cpp:5: note: candidates are: bound_member_action<int>::bound_member_action(const bound_member_action<int>&) g++ (GCC) 3.4.2 (Amiga, Inc. build 20040910) Encountered when building Boost Spirit/Phoenix library test suite.
Testing a patch
Patch here: http://gcc.gnu.org/ml/gcc-patches/2005-01/msg01305.html
Subject: Bug 19208 CVSROOT: /cvs/gcc Module name: gcc Changes by: giovannibajo@gcc.gnu.org 2005-01-21 02:27:17 Modified files: gcc/cp : ChangeLog pt.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/template: array11.C Log message: PR c++/19208 * pt.c (fold_decl_constant_value): Always call fold_non_dependent_expr at least once. (tsubst): Use fold_decl_constant_value in place of a bare call to integral_constant_value. PR c++/19208 * g++.dg/template/array11.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4589&r2=1.4590 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&r1=1.967&r2=1.968 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4916&r2=1.4917 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/array11.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
Fixed in 4.0, the patch needs a little bit of tweaking for 3.4.
Removing 4.0.0 from known-to-fail list.
Patch posted for 3.4: http://gcc.gnu.org/ml/gcc-patches/2005-07/msg01653.html
Subject: Bug 19208 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_4-branch Changes by: giovannibajo@gcc.gnu.org 2005-07-25 21:13:18 Modified files: gcc/cp : ChangeLog pt.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/template: array11.C Log message: cp/ PR c++/19208 * pt.c (tsubst): Use fold_non_dependent_expr to fold array domains. testsuite/ PR c++/19208 * g++.dg/template/array11.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3892.2.227&r2=1.3892.2.228 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.816.2.55&r2=1.816.2.56 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3389.2.408&r2=1.3389.2.409 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/array11.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.34.1
Fixed in GCC 3.4.5 too.