public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/21413] diagnostic for instantiation should also reference the function which it is where the instantiation happens
       [not found] <bug-21413-6594@http.gcc.gnu.org/bugzilla/>
@ 2006-10-21 20:36 ` pinskia at gcc dot gnu dot org
  2006-10-21 20:39 ` pinskia at gcc dot gnu dot org
  2006-10-21 21:16 ` igodard at pacbell dot net
  2 siblings, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-10-21 20:36 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1289 bytes --]



------- Comment #5 from pinskia at gcc dot gnu dot org  2006-10-21 20:36 -------
My reduced testcase, you get the following error:
t.cc: In instantiation of ‘a<float>’:
t.cc:11:   instantiated from here
t.cc:3: error: ‘float’ is not a class, struct, or union type


I don't see how this is the incorrect diagnostic for this case.
Maybe it should reference line 7 but that is asking for an improvement.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |diagnostic
   Last reconfirmed|0000-00-00 00:00:00         |2006-10-21 20:36:45
               date|                            |
            Summary|bogus diagnostic from       |diagnostic for instantiation
                   |unidentified template       |should also reference the
                   |                            |function which it is where
                   |                            |the instantiation happens


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


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

* [Bug c++/21413] diagnostic for instantiation should also reference the function which it is where the instantiation happens
       [not found] <bug-21413-6594@http.gcc.gnu.org/bugzilla/>
  2006-10-21 20:36 ` [Bug c++/21413] diagnostic for instantiation should also reference the function which it is where the instantiation happens pinskia at gcc dot gnu dot org
@ 2006-10-21 20:39 ` pinskia at gcc dot gnu dot org
  2006-10-21 21:16 ` igodard at pacbell dot net
  2 siblings, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-10-21 20:39 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from pinskia at gcc dot gnu dot org  2006-10-21 20:39 -------
Comeau online has the same issue:
"ComeauTest.c", line 3: error: name followed by "::" must be a class or
namespace
          name... Wild guess: Did you #include the right header?
    typedef typename TT::value_type value_type;
                     ^
          detected during instantiation of class "a<TT> [with TT=float]" at
                    line 11

See how it refers to a<float> and line 11 in the same way.


-- 


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


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

* [Bug c++/21413] diagnostic for instantiation should also reference the function which it is where the instantiation happens
       [not found] <bug-21413-6594@http.gcc.gnu.org/bugzilla/>
  2006-10-21 20:36 ` [Bug c++/21413] diagnostic for instantiation should also reference the function which it is where the instantiation happens pinskia at gcc dot gnu dot org
  2006-10-21 20:39 ` pinskia at gcc dot gnu dot org
@ 2006-10-21 21:16 ` igodard at pacbell dot net
  2 siblings, 0 replies; 3+ messages in thread
From: igodard at pacbell dot net @ 2006-10-21 21:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from igodard at pacbell dot net  2006-10-21 21:16 -------
Please forgive my naive understanding of the standard, but it was my impression 
that the return type of a function never participated in overload resolution. 
That is, for any given set of overloads and a call, the return types of the 
overloads can be changed arbitrarily and in all cases the compiler should 
produce the same identification (if successful) or same diagnostic (if not).

We have here a case where this rule (if rule it is) is violated. If the 
overloads are:
   template<typename T> void foo(int);
   template<typename C> typename a<C>::value_type foo(const C&);
then you get a diagnostic, but if the overloads are:
   template<typename T> void foo(int);
   template<typename C> void foo(const C&);
then you don't. I leave to wiser heads whether a diagnostic should issue, but 
whether it should or should not then it should (or should not) in both cases.

Ivan


-- 


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


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

end of thread, other threads:[~2006-10-21 21:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-21413-6594@http.gcc.gnu.org/bugzilla/>
2006-10-21 20:36 ` [Bug c++/21413] diagnostic for instantiation should also reference the function which it is where the instantiation happens pinskia at gcc dot gnu dot org
2006-10-21 20:39 ` pinskia at gcc dot gnu dot org
2006-10-21 21:16 ` igodard at pacbell dot net

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