public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/20261] New: Error with integral-constant expression in template
@ 2005-03-01 14:23 redi at gcc dot gnu dot org
2005-03-01 14:32 ` [Bug c++/20261] " pinskia at gcc dot gnu dot org
0 siblings, 1 reply; 2+ messages in thread
From: redi at gcc dot gnu dot org @ 2005-03-01 14:23 UTC (permalink / raw)
To: gcc-bugs
Given this code:
template<typename T, T N> struct int_ {
static const T value = N;
typedef int_< T, static_cast<T>(value+1) > next;
};
GCC says:
intconst2.cc:3: error: template argument 2 is invalid
It works if you replace "value" with "N".
Possibly related to recent changes to C++ parser disallow floating-point
literals in integral-constant expressions? Appeared around the same time.
This causes compilation failures in Boost.MPL
--
Summary: Error with integral-constant expression in template
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Keywords: rejects-valid
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: redi at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20261
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug c++/20261] Error with integral-constant expression in template
2005-03-01 14:23 [Bug c++/20261] New: Error with integral-constant expression in template redi at gcc dot gnu dot org
@ 2005-03-01 14:32 ` pinskia at gcc dot gnu dot org
0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-03-01 14:32 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-03-01 14:32 -------
This has already fixed in a later version of gcc, at least 20050225.
This is a dup of bug 20220.
*** This bug has been marked as a duplicate of 20220 ***
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20261
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-03-01 14:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-01 14:23 [Bug c++/20261] New: Error with integral-constant expression in template redi at gcc dot gnu dot org
2005-03-01 14:32 ` [Bug c++/20261] " pinskia at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).