public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/27211]  New: Bogus error "template definition of non-template" when there is no non-template
@ 2006-04-19  9:11 reichelt at gcc dot gnu dot org
  2006-04-22 20:27 ` [Bug c++/27211] " pinskia at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2006-04-19  9:11 UTC (permalink / raw)
  To: gcc-bugs

The following testcase generates a questionable diagnostic:

===================================
struct A {};

template<int> void A::foo() {}
===================================

bug1.cc:3: error: no 'void A::foo()' member function declared in class 'A'
bug1.cc:3: error: template definition of non-template 'void A::foo()'

The second line is bogus, because there is no non-template definition
of A::foo. (This happens since at least GCC 2.95.x).

A slightly different testcase generates an even worse diagnostic:

===================================
struct A {};

template<int> void A::foo();
===================================

bug2.cc:3: error: no 'void A::foo()' member function declared in class 'A'
bug2.cc:3: error: prototype for 'void A::foo()' does not match any in class 'A'
bug2.cc:3: error: candidate is: void A::foo()
bug2.cc:3: error: declaration of 'void A::foo()' outside of class is not
definition
bug2.cc:3: error: template definition of non-template 'void A::foo()'

Here we also have a bogus "candidate is" message.


-- 
           Summary: Bogus error "template definition of non-template" when
                    there is no non-template
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: diagnostic, monitored
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: reichelt at gcc dot gnu dot org


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


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

end of thread, other threads:[~2007-08-14 22:16 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-19  9:11 [Bug c++/27211] New: Bogus error "template definition of non-template" when there is no non-template reichelt at gcc dot gnu dot org
2006-04-22 20:27 ` [Bug c++/27211] " pinskia at gcc dot gnu dot org
2006-05-26 15:30 ` bangerth at dealii dot org
2006-07-19 11:04 ` reichelt at gcc dot gnu dot org
2006-08-04 21:54 ` reichelt at gcc dot gnu dot org
2007-07-23 20:55 ` reichelt at gcc dot gnu dot org
2007-08-13 19:04 ` pcarlini at suse dot de
2007-08-14 22:07 ` paolo at gcc dot gnu dot org
2007-08-14 22:14 ` paolo at gcc dot gnu dot org
2007-08-14 22:16 ` pcarlini at suse dot de

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