This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/48003] [4.6 Regression] Regression in Template Constants from 4.5.2
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 7 Mar 2011 10:30:36 +0000
- Subject: [Bug c++/48003] [4.6 Regression] Regression in Template Constants from 4.5.2
- Auto-submitted: auto-generated
- References: <bug-48003-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48003
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |diagnostic
Status|UNCONFIRMED |NEW
Last reconfirmed| |2011.03.07 10:30:34
Target Milestone|--- |4.6.0
Summary|Regression in Template |[4.6 Regression] Regression
|Constants from 4.5.2 |in Template Constants from
| |4.5.2
Ever Confirmed|0 |1
--- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-03-07 10:30:34 UTC ---
At least the error is confusing:
/usr/local/include/boost/mpl/aux_/integral_wrapper.hpp:73:96: error:
â2147483647â is not a valid template argument for type âintâ because
it is a non-constant expression
as â2147483647â clearly looks like a constant expression ;) It probably
should say '-2147483648 - 1' is not a constant expression - not sure
how difficult that would be.
-fpermissive doesn't make us accept the code.
Testcase w/o include:
template<int N>
struct test
{
typedef test<N - 1> prior;
};
typedef test<-2147483647-1> foo;
foo f;
int main()
{
}
4.5 issues
t.C: In instantiation of 'test<-0x00000000080000000>':
t.C:9:5: instantiated from here
t.C:4:31: warning: integer overflow in expression
that makes more sense. We probably can go back to this behavior with
-fpermissive if accepting TREE_OVERFLOW consts as constant expressions.