public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/3478: ICE when using enum from template class
@ 2002-12-04  5:16 Volker Reichelt
  0 siblings, 0 replies; 3+ messages in thread
From: Volker Reichelt @ 2002-12-04  5:16 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/3478; it has been noted by GNATS.

From: Volker Reichelt <reichelt@igpm.rwth-aachen.de>
To: gcc-gnats@gcc.gnu.org, jthorn@thp.univie.ac.at, gcc-bugs@gcc.gnu.org,
        nobody@gcc.gnu.org
Cc:  
Subject: Re: c++/3478: ICE when using enum from template class
Date: Wed, 4 Dec 2002 15:08:15 +0100

 Hi,
 
 a cleaned-up testcase is the following (crashes 2.95.x, 3.0.x,
 3.2-branch and mainline):
 
 ----------------------------snip here--------------------------
 template <typename T> struct A
 {
     enum E {};
 };
 
 template <typename T> void foo()
 {
     enum     A<void>::E e1; // OK
     typename A<T>::E    e2; // OK
     enum     A<T>::E    e3; // crashes
 }
 ----------------------------snip here--------------------------
 
 Regards,
 Volker
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=3478
 
 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: c++/3478: ICE when using enum from template class
@ 2001-07-09  6:46 lerdsuwa
  0 siblings, 0 replies; 3+ messages in thread
From: lerdsuwa @ 2001-07-09  6:46 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, jthorn, nobody

Synopsis: ICE when using enum from template class

State-Changed-From-To: open->analyzed
State-Changed-By: lerdsuwa
State-Changed-When: Mon Jul  9 06:46:16 2001
State-Changed-Why:
    Confirm as a bug.  It still exists in gcc 3.0.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=3478&database=gcc


^ permalink raw reply	[flat|nested] 3+ messages in thread

* c++/3478: ICE when using enum from template class
@ 2001-06-29  8:06 jthorn
  0 siblings, 0 replies; 3+ messages in thread
From: jthorn @ 2001-06-29  8:06 UTC (permalink / raw)
  To: gcc-gnats; +Cc: jthorn

>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==


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-12-04 13:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-04  5:16 c++/3478: ICE when using enum from template class Volker Reichelt
  -- strict thread matches above, loose matches on Subject: below --
2001-07-09  6:46 lerdsuwa
2001-06-29  8:06 jthorn

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