Bug 20401 - error message is misleading
Summary: error message is misleading
Status: RESOLVED DUPLICATE of bug 100
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.4.3
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-10 09:46 UTC by papadopo
Modified: 2005-07-23 22:49 UTC (History)
1 user (show)

See Also:
Host: sparc-sun-solaris2.8
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
test case (111 bytes, text/plain)
2005-03-10 09:48 UTC, papadopo
Details
stripped down test case (87 bytes, text/plain)
2005-03-10 09:49 UTC, papadopo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description papadopo 2005-03-10 09:46:37 UTC
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.
Comment 1 papadopo 2005-03-10 09:48:48 UTC
Created attachment 8371 [details]
test case
Comment 2 papadopo 2005-03-10 09:49:45 UTC
Created attachment 8372 [details]
stripped down test case
Comment 3 Wolfgang Bangerth 2005-03-10 19:55:19 UTC
This is a duplicate of a good number of other PRs. I don't have the time 
right now to find them, though... 
 
W. 
Comment 4 Andrew Pinski 2005-03-10 19:56:49 UTC
I could sware I closed this as a dup of bug 100 before.

*** This bug has been marked as a duplicate of 100 ***