17609 – [3.4 Regression] spurious error message after using keyword (original) (raw)
The 3.4 C++ compiler emits two errors on the following code. Only the first one should be emitted (that's the case with gcc 3.3). That's not a serious bug since the second error message disappears when the first one is fixed, but it's disturbing nevertheless.
$ cat > foo.cc
#include
void function1() {
cout;
}
using namespace std;
void function2() {
cout;
}
$
$ g++ -c foo.cc
foo.cc: In function void function1()': foo.cc:3: error: cout' undeclared (first use this function)
foo.cc:3: error: (Each undeclared identifier is reported only once for each
function it appears in.)
foo.cc: In function void function2()': foo.cc:7: error: cout' undeclared (first use this function)
$
Comment 1 Drea Pinski 2004-09-22 13:00:08 UTC
Confirmed, a 3.4 regression only.
Comment 2 Mark Mitchell 2004-11-01 00:46:02 UTC
Postponed until GCC 3.4.4.
Comment 4 Volker Reichelt 2005-09-21 15:12:47 UTC
This is now fixed in GCC 3.4.5.
The new testcase g++.dg/lookup/error1.C will be added to mainline and the 4.0 branch. In the meantime I'll keep the PR open.
Comment 6 Volker Reichelt 2005-09-21 15:23:08 UTC
Testcase now also in mainline. Waiting for 4.0 branch to unfreeze.
Comment 8 Volker Reichelt 2005-10-05 15:37:43 UTC
Testcase now also on the 4.0 branch.