public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/25751]  New: Poor error when templating on undefined types
@ 2006-01-11 15:22 chris at bubblescope dot net
  2006-02-02 19:47 ` [Bug c++/25751] " pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 5+ messages in thread
From: chris at bubblescope dot net @ 2006-01-11 15:22 UTC (permalink / raw)
  To: gcc-bugs

#include <vector>

int main(void)
{
  std::vector<foo> v;
  v.begin();
}

Produces:

temp.cc: In function 'int main()':
temp.cc:5: error: 'foo' was not declared in this scope
temp.cc:5: error: template argument 1 is invalid
temp.cc:5: error: template argument 2 is invalid
temp.cc:5: error: invalid type in declaration before ';' token
temp.cc:6: error: request for member 'begin' in 'v', which is of non-class type
'int'

That last warning doesn't seem to make any sense. Perhaps g++ should abandon
parsing / producing errors earlier?


-- 
           Summary: Poor error when templating on undefined types
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: chris at bubblescope dot net


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



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

* [Bug c++/25751] Poor error when templating on undefined types
  2006-01-11 15:22 [Bug c++/25751] New: Poor error when templating on undefined types chris at bubblescope dot net
@ 2006-02-02 19:47 ` pinskia at gcc dot gnu dot org
  0 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-02-02 19:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-02-02 19:47 -------
Confirmed.

What should happen here is that when foo is not declared in this context, we
should try to figure out if it was going to be used as a type or a variable. 
Right now we assume it is used as a variable.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2006-02-02 19:47:04
               date|                            |


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


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

* [Bug c++/25751] Poor error when templating on undefined types
       [not found] <bug-25751-4@http.gcc.gnu.org/bugzilla/>
  2012-05-24 15:25 ` paolo.carlini at oracle dot com
  2012-05-24 15:30 ` paolo.carlini at oracle dot com
@ 2022-01-07  5:56 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-01-07  5:56 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25751

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Reduced testcase:
template<class> struct gg{};
int main(void)
{
  gg<t> v;
  v.begin();
}

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

* [Bug c++/25751] Poor error when templating on undefined types
       [not found] <bug-25751-4@http.gcc.gnu.org/bugzilla/>
  2012-05-24 15:25 ` paolo.carlini at oracle dot com
@ 2012-05-24 15:30 ` paolo.carlini at oracle dot com
  2022-01-07  5:56 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 5+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-05-24 15:30 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|gcc-bugs at gcc dot gnu.org |
         AssignedTo|unassigned at gcc dot       |paolo.carlini at oracle dot
                   |gnu.org                     |com

--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-05-24 15:25:35 UTC ---
Let's see if we can make some progress.


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

* [Bug c++/25751] Poor error when templating on undefined types
       [not found] <bug-25751-4@http.gcc.gnu.org/bugzilla/>
@ 2012-05-24 15:25 ` paolo.carlini at oracle dot com
  2012-05-24 15:30 ` paolo.carlini at oracle dot com
  2022-01-07  5:56 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 5+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-05-24 15:25 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu.org

--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-05-24 15:22:08 UTC ---
*** Bug 53412 has been marked as a duplicate of this bug. ***


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

end of thread, other threads:[~2022-01-07  5:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-11 15:22 [Bug c++/25751] New: Poor error when templating on undefined types chris at bubblescope dot net
2006-02-02 19:47 ` [Bug c++/25751] " pinskia at gcc dot gnu dot org
     [not found] <bug-25751-4@http.gcc.gnu.org/bugzilla/>
2012-05-24 15:25 ` paolo.carlini at oracle dot com
2012-05-24 15:30 ` paolo.carlini at oracle dot com
2022-01-07  5:56 ` pinskia at gcc dot gnu.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).