public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/10126: ICE on template code
@ 2003-03-18  0:16 Marco.Franzen
  0 siblings, 0 replies; only message in thread
From: Marco.Franzen @ 2003-03-18  0:16 UTC (permalink / raw)
  To: gcc-gnats


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


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

only message in thread, other threads:[~2003-03-18  0:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-18  0:16 c++/10126: ICE on template code Marco.Franzen

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