public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/3870
@ 2001-09-19 10:56 Martin Sebor
  0 siblings, 0 replies; only message in thread
From: Martin Sebor @ 2001-09-19 10:56 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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

From: Martin Sebor <sebor@roguewave.com>
To: gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org,
 	gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org
Cc:  
Subject: Re: c++/3870
Date: Wed, 19 Sep 2001 11:59:02 -0600

 While trying to work around this
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=3870&database=gcc
 
 I discovered that subsequent declarations compile fine. How bizarre!
 
 Martin
 
 
 template <class T>
 struct A { typedef int I; };
 
 template <class T>
 typename T::I
 foo (typename T::I, const T*);
 
 template <>
 int foo (int i, const A<long>*)
 {
     return 0; // i + 1;   // comment out to prevent error
 }
 
 #define foo bar
 
 template <class T>
 typename T::I
 foo (typename T::I, const T*);
 
 template <>
 int foo (int i, const A<long>*)
 {
     return i + 1;   // voila, it now works!
 }
 
 int main ()
 {
     return bar (0, (A<long>*)0);
 }


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

only message in thread, other threads:[~2001-09-19 10:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-19 10:56 c++/3870 Martin Sebor

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