public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/6030: ...
@ 2003-01-13  5:16 Philippe A. Bouchard
  0 siblings, 0 replies; 2+ messages in thread
From: Philippe A. Bouchard @ 2003-01-13  5:16 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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

>From philippeb@videotron.ca  Mon Jan 13 01:09:28 2003
From: "Philippe A. Bouchard" <philippeb@videotron.ca>
To: neroden@twcny.rr.com, gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org,
 nobody@gcc.gnu.org
Cc:  
Subject: Re: c++/6030: ...
Date: Mon, 13 Jan 2003 00:11:40 -0500

 ----- Original Message -----
 From: "Nathanael Nerode" <neroden@twcny.rr.com>
 To: <philippeb@videotron.ca>; <gcc-gnats@gcc.gnu.org>;
 <gcc-bugs@gcc.gnu.org>; <nobody@gcc.gnu.org>
 Sent: Saturday, January 11, 2003 6:57 PM
 Subject: Re: c++/6030: ...
 
 
 > I'm a little confused by all this, but note that the following seems to
 work:
 > --
 
 [...]
 
 > int main()
 > {
 >         foo<int, 9>();
 >         foo<blah_fn, b>();
 > }
 
 [...]
 
 > int main()
 > {
 >         foo<int, 9>();
 >         foo<int (*) (void), b>();
 > }
 > --
 >
 > This seems like a sufficient workaround for most any purpose.  It also
 works
 > if you replace the * by &.
 >
 > And it leaves me wondering about the validity of the original. :-)
 
 Yes, you're right: non-type non-reference template parameters cannot be of
 function type (14.1.3 - .4).  But I would suggest clarifying the error
 report: "no matching function for call to foo()" with some "invalid non-type
 type".
 
 
 
 Thanks,
 
 Philippe A. Bouchard
 
 


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

* Re: c++/6030: ...
@ 2003-01-12  0:06 Nathanael Nerode
  0 siblings, 0 replies; 2+ messages in thread
From: Nathanael Nerode @ 2003-01-12  0:06 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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

>From neroden@twcny.rr.com  Mon Jan 13 01:03:02 2003
From: Nathanael Nerode <neroden@twcny.rr.com>
To: philippeb@videotron.ca, gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org,
   nobody@gcc.gnu.org
Cc:  
Subject: Re: c++/6030: ...
Date: Sat, 11 Jan 2003 18:57:18 -0500

 I'm a little confused by all this, but note that the following seems to work:
 --
 #include <utility>
 #include <iostream>
 
 using namespace std;
 
 template <typename _T, _T _V>
         void foo()
         {
                 cout << __PRETTY_FUNCTION__ << endl;
         }
 
 int a = 0;
 
 int b(void) { cout << __PRETTY_FUNCTION__ << endl; }
 
 typedef int (* blah_fn) (void) ;
 
 int main()
 {
         foo<int, 9>();
         foo<blah_fn, b>();
 }
 --
 
 And so does the following:
 --
 #include <utility>
 #include <iostream>
 
 using namespace std;
 
 template <typename _T, _T _V>
         void foo()
         {
                 cout << __PRETTY_FUNCTION__ << endl;
         }
 
 int a = 0;
 
 int b(void) { cout << __PRETTY_FUNCTION__ << endl; }
 
 int main()
 {
         foo<int, 9>();
         foo<int (*) (void), b>();
 }
 --
 
 This seems like a sufficient workaround for most any purpose.  It also works 
 if you replace the * by &.
 
 And it leaves me wondering about the validity of the original. :-)


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

end of thread, other threads:[~2003-01-13  5:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-13  5:16 c++/6030: Philippe A. Bouchard
  -- strict thread matches above, loose matches on Subject: below --
2003-01-12  0:06 c++/6030: Nathanael Nerode

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