Bug 20220 - [4.0/4.1 Regression] Rejecting invalid template code, breaks most of Boost
Summary: [4.0/4.1 Regression] Rejecting invalid template code, breaks most of Boost
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.0.0
: P2 critical
Target Milestone: 4.0.0
Assignee: Not yet assigned to anyone
URL:
Keywords: rejects-valid
: 20261 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-02-26 00:44 UTC by Giovanni Bajo
Modified: 2005-03-01 14:32 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-02-26 00:55:09


Attachments
Preprocessed source (to be reduced) (86.18 KB, application/octet-stream)
2005-02-26 00:46 UTC, Giovanni Bajo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Giovanni Bajo 2005-02-26 00:44:33 UTC
The attached preprocessed source code is an example of a recent regresion of 
the C++ frontend which totally *kills* Boost: test rate dropped from 90% to 9% 
because of this! This used to work like 2 weeks ago...
Comment 1 Giovanni Bajo 2005-02-26 00:46:01 UTC
Created attachment 8288 [details]
Preprocessed source (to be reduced)
Comment 2 Andrew Pinski 2005-02-26 00:55:09 UTC
Easy reduction:
template <class T, T i> class b {};
template <class T, T i> class a
{
static const T value = i;
  b<T, static_cast<T>(value+1) > next;
};
Comment 3 Andrew Pinski 2005-02-26 00:58:02 UTC
This worked with 4.0.0 20050113 but fails with 20050210.
Comment 4 Giovanni Bajo 2005-02-26 12:01:50 UTC
I forgot to thank Martin Wille for notifying me of this bug and providing me 
with this testcase.
Comment 5 Andrew Pinski 2005-02-28 01:09:39 UTC
(In reply to comment #3)
> This worked with 4.0.0 20050113 but fails with 20050210.
To get a smaller window, it fails with 20050201.
Hmm, it passes with 20050225.
I think this was fixed by:
        PR c++/19991
        * init.c (integral_constant_value): Iterate if the value of a decl
        is itself a constant.

Since this is fixed both the orginal full test case and the reduced version, I am going to close it as fixed.
Giovanni if you want to apply the testcase I think that would be useful for the future.
Comment 6 Andrew Pinski 2005-03-01 14:32:39 UTC
*** Bug 20261 has been marked as a duplicate of this bug. ***