public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/20401] New: error message is misleading
@ 2005-03-10  9:46 papadopo at shfj dot cea dot fr
  2005-03-10  9:48 ` [Bug c++/20401] " papadopo at shfj dot cea dot fr
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: papadopo at shfj dot cea dot fr @ 2005-03-10  9:46 UTC (permalink / raw)
  To: gcc-bugs

The error message in this case is misleading:

$ cat foo.cc
#include <unistd.h>

namespace foo {
typedef long long offset_t;
}

using namespace std;
using namespace foo;

int main() {
    offset_t fpos;
}
$ 
$ g++ -c foo.cc
foo.cc: In function `int main()':
foo.cc:11: error: `offset_t' undeclared (first use this function)
foo.cc:11: error: (Each undeclared identifier is reported only once for each
   function it appears in.)
foo.cc:11: error: parse error before `;' token
$ 

Actually 'offset_t' is declared twice, once in the global namespace in Solaris'
<sys/types.h> and once in the foo namespace.

-- 
           Summary: error message is misleading
           Product: gcc
           Version: 3.4.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: papadopo at shfj dot cea dot fr
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: sparc-sun-solaris2.8


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


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

end of thread, other threads:[~2005-03-10 19:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-10  9:46 [Bug c++/20401] New: error message is misleading papadopo at shfj dot cea dot fr
2005-03-10  9:48 ` [Bug c++/20401] " papadopo at shfj dot cea dot fr
2005-03-10  9:49 ` papadopo at shfj dot cea dot fr
2005-03-10 19:55 ` bangerth at dealii dot org
2005-03-10 19:56 ` 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).