This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/25751] New: Poor error when templating on undefined types


#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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]