public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/2559: Boost testsuite ICEs (long long template parameters)
@ 2001-04-16  9:06 pcarlini
  0 siblings, 0 replies; only message in thread
From: pcarlini @ 2001-04-16  9:06 UTC (permalink / raw)
  To: gcc-gnats

>Number:         2559
>Category:       c++
>Synopsis:       Boost testsuite ICEs (long long template parameters)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Apr 16 09:06:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Paolo Carlini
>Release:        3.1 20010412 (experimental) and also Codesourcery on line
>Organization:
>Environment:
i686, Linux2.2.19, glibc2.2.2, binutils2.11	
>Description:
The following code, distilled from Boost 1.21.1 (www.boost.org) header file 
integer_traits.hpp, triggers an ICE:

-------

template<class T, T min_val, T max_val>
class integer_traits_base
{
public:
  static const bool is_integral = true;
};

template<class T>
class integer_traits
{
public:
  static const bool is_integral = false;
};

template<>
class integer_traits<long long>
  : public integer_traits_base<long long, (-9223372036854775807LL - 1),
9223372036854775807LL>
{ };

-------

Three Boost regression testsuite tests presently fail due to (at least) this problem, i.e. integer_traits_test.cpp, random_test.cpp, random_demo.cpp.
>How-To-Repeat:
The ICE appear connected to the sign of the large constants as template parameters: interestingly if the testcase is modified by changing their sign to *positive*, the compiler isuues "sorry, not implemented: mangling very large integers".

Gcc2.95.2 compiles this code, however I believe that such large constants are not valid in ANSI/ISO C++ (without long long extension), so the bug should be qualified as "ICE on illegal code". In my opinion, Boost should not rely on long long constants as template parameters.
 		
>Fix:

In the short term, seems far easier to fix Boost ;)
It should be relatively easy for the C++ gurus to fix the front end to catch large *negative* (vs. positive) integers template parameters and emit the proper diagnostics.
 \x18
>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-04-16  9:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-04-16  9:06 c++/2559: Boost testsuite ICEs (long long template parameters) pcarlini

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).