This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/10126: ICE on template code
- From: Marco dot Franzen at bigfoot dot com
- To: gcc-gnats at gcc dot gnu dot org
- Date: Tue, 18 Mar 2003 00:11:18 +0000
- Subject: c++/10126: ICE on template code
>Number: 10126
>Category: c++
>Synopsis: ICE on template code
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: ice-on-legal-code
>Submitter-Id: net
>Arrival-Date: Tue Mar 18 00:16:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: Marco Franzen
>Release: 3.2.2
>Organization:
>Environment:
System: Linux pika 2.2.20 #1 Sat Apr 20 11:45:28 EST 2002 i586 unknown
Architecture: i586
host: i586-pc-linux-gnu
build: i586-pc-linux-gnu
target: i586-pc-linux-gnu
configured with: ../../src/gcc-3.2.2/configure --prefix=/usr/local/gcc-3.2.2/ --program-suffix=-3.2.2
>Description:
The following code results in strawberry ICE scream.
>How-To-Repeat:
Compile the following code.
class Fruit {
int theI;
public:
int const& I () const { return theI; }
int & I () { return theI; }
};
class Strawberry: public Fruit {
public:
using Fruit::I;
};
class Dish {
Strawberry s1;
public:
template <int const& (Strawberry::*fun)() const>
int const & Get() const { return (s1.*fun)(); }
};
int
main ()
{
Dish dish; dish.Get<&Strawberry::I>();
return 0;
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: