public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: jthorn@thp.univie.ac.at
To: gcc-gnats@gcc.gnu.org
Cc: jthorn@thp.univie.ac.at
Subject: c++/3478: ICE when using enum from template class
Date: Fri, 29 Jun 2001 08:06:00 -0000	[thread overview]
Message-ID: <20010629150459.19336.qmail@sourceware.cygnus.com> (raw)

>Number:         3478
>Category:       c++
>Synopsis:       ICE when using enum from template class
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-legal-code
>Submitter-Id:   net
>Arrival-Date:   Fri Jun 29 08:06:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Jonathan Thornburg
>Release:        gcc version 2.95.2 19991024 (release)
>Organization:
>Environment:
bug occurs for both i586-pc-linux-gnu (Red Hat Linux release 6.2 (Zoot))
and for alphaev56-dec-osf4.0d (Digital UNIX V4.0D  (Rev. 878))
>Description:
% /usr/local/share2/bin/g++ -v -save-temps -Wall -c bad.cc
Reading specs from /usr/local/share2/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/specs
gcc version 2.95.2 19991024 (release)
 /usr/local/share2/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/cpp -lang-c++ -v -D__GNU
C__=2 -D__GNUG__=2 -D__GNUC_MINOR__=95 -D__cplusplus -D__ELF__ -Dunix -D__i386__
 -Dlinux -D__ELF__ -D__unix__ -D__i386__ -D__linux__ -D__unix -D__linux -Asystem
(posix) -D__EXCEPTIONS -Wall -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i38
6__ -Di586 -Dpentium -D__i586 -D__i586__ -D__pentium -D__pentium__ bad.cc bad.ii
GNU CPP version 2.95.2 19991024 (release) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/share2/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/../../../../include/g++-
3
 /usr/local/include
 /usr/local/share2/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/../../../../i586-pc-linu
x-gnu/include
 /usr/local/share2/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/include
 /usr/include
End of search list.
The following default directories have been omitted from the search path:
End of omitted list.
 /usr/local/share2/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/cc1plus bad.ii -quiet -d
umpbase bad.cc -Wall -version -o bad.s
GNU C++ version 2.95.2 19991024 (release) (i586-pc-linux-gnu) compiled by GNU C 
version 2.95.2 19991024 (release).
bad.cc: In function `void bar(int)':
bad.cc:15: warning: unused variable `const enum linear_map<double>::noninteger_a
ction floor_or_round'
bad.cc: In function `void foo()':
bad.cc:22: Internal compiler error.
bad.cc:22: Please submit a full bug report.
bad.cc:22: See <URL: http://www.gnu.org/software/gcc/faq.html#bugreport > for inst
ructions.
%
>How-To-Repeat:
Compiling the following C++ program causes an ICE,
reported at the line (22) in foo() containing the assignment.

// bad.cc -- tickle gcc bug

inline int is_even(int i) { return !(i & 0x1); }

template <typename fpt>
class   linear_map
        {
public:
        enum noninteger_action { error, warning, round, floor, ceiling };
        };

void bar(int N_interp)
{
const enum linear_map<double>::noninteger_action floor_or_round
        = is_even(N_interp) ? linear_map<double>::floor
                            : linear_map<double>::round;
}

template <typename fpt> void foo()
{
const enum linear_map<fpt>::noninteger_action floor_or_round
        = is_even(N_interp) ? linear_map<fpt>::floor
                            : linear_map<fpt>::round;
}
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="bad.cc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="bad.cc"

Ly8gYmFkLmNjIC0tIHRpY2tsZSBnY2MgYnVnCgppbmxpbmUgaW50IGlzX2V2ZW4oaW50IGkpIHsg
cmV0dXJuICEoaSAmIDB4MSk7IH0KCnRlbXBsYXRlIDx0eXBlbmFtZSBmcHQ+CmNsYXNzCWxpbmVh
cl9tYXAKCXsKcHVibGljOgoJZW51bSBub25pbnRlZ2VyX2FjdGlvbiB7IGVycm9yLCB3YXJuaW5n
LCByb3VuZCwgZmxvb3IsIGNlaWxpbmcgfTsKCX07Cgp2b2lkIGJhcihpbnQgTl9pbnRlcnApCnsK
Y29uc3QgZW51bSBsaW5lYXJfbWFwPGRvdWJsZT46Om5vbmludGVnZXJfYWN0aW9uIGZsb29yX29y
X3JvdW5kCgk9IGlzX2V2ZW4oTl9pbnRlcnApID8gbGluZWFyX21hcDxkb3VibGU+OjpmbG9vcgoJ
CQkgICAgOiBsaW5lYXJfbWFwPGRvdWJsZT46OnJvdW5kOwp9Cgp0ZW1wbGF0ZSA8dHlwZW5hbWUg
ZnB0PiB2b2lkIGZvbygpCnsKY29uc3QgZW51bSBsaW5lYXJfbWFwPGZwdD46Om5vbmludGVnZXJf
YWN0aW9uIGZsb29yX29yX3JvdW5kCgk9IGlzX2V2ZW4oTl9pbnRlcnApID8gbGluZWFyX21hcDxm
cHQ+OjpmbG9vcgoJCQkgICAgOiBsaW5lYXJfbWFwPGZwdD46OnJvdW5kOwp9Cg==


             reply	other threads:[~2001-06-29  8:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-29  8:06 jthorn [this message]
2001-07-09  6:46 lerdsuwa
2002-12-04  5:16 Volker Reichelt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010629150459.19336.qmail@sourceware.cygnus.com \
    --to=jthorn@thp.univie.ac.at \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).