public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/45490]  New: Confusing error message for local type arguments
@ 2010-09-01 21:34 giecrilj at stegny dot 2a dot pl
  2010-09-01 21:36 ` [Bug c++/45490] " pinskia at gcc dot gnu dot org
  2010-09-01 21:37 ` pinskia at gcc dot gnu dot org
  0 siblings, 2 replies; 3+ messages in thread
From: giecrilj at stegny dot 2a dot pl @ 2010-09-01 21:34 UTC (permalink / raw)
  To: gcc-bugs

#include <algorithm>

void foo (void) 
{ 
class my_iter: 
 public std:: iterator <std:: random_access_iterator_tag, int > 
 { public: operator int * (void) const { return NULL; }}; 

std:: distance (my_iter (), my_iter ()); }

Compiling this code, you get:

error: no matching function for call to &#8216;distance(foo()::my_iter,
foo()::my_iter)&#8217;

This message is highly confusing.

Both Intel and Comeau give the following message:

a template argument may not reference a local type

(Microsoft groks the construct all right.)


-- 
           Summary: Confusing error message for local type arguments
           Product: gcc
           Version: 4.4.1
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: giecrilj at stegny dot 2a dot pl
 GCC build triplet: x86_64-suse-linux
  GCC host triplet: x86_64-suse-linux
GCC target triplet: x86_64-suse-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45490


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

end of thread, other threads:[~2010-10-01  0:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-45490-4@http.gcc.gnu.org/bugzilla/>
2010-10-01  0:05 ` [Bug c++/45490] Confusing error message for local type arguments pinskia at gcc dot gnu.org
2010-09-01 21:34 [Bug c++/45490] New: " giecrilj at stegny dot 2a dot pl
2010-09-01 21:36 ` [Bug c++/45490] " pinskia at gcc dot gnu dot org
2010-09-01 21:37 ` pinskia at gcc dot gnu dot org

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