[Bug c++/57883] New: Feature request: better diagnostic for unknown type
dushistov at mail dot ru
gcc-bugzilla@gcc.gnu.org
Thu Jul 11 21:06:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57883
Bug ID: 57883
Summary: Feature request: better diagnostic for unknown type
Product: gcc
Version: 4.8.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: dushistov at mail dot ru
$cat test.cpp
//#include <cstddef>
struct vec {
double x;
double y;
double z;
double& operator[](size_t i) {
switch (i) {
case 0:
return x;
case 1:
return y;
case 2:
return z;
}
}
};
g++ -c -Wall -std=c++11 test.cpp
test.cpp:8:21: error: declaration of 'operator[]' as non-function
double& operator[](size_t i) {
plus more not related errors
...
This is completly wrong message, but at the same time
clang++ -c -Wall -std=c++11 test.cpp
test.cpp:8:21: error: unknown type name 'size_t'
double& operator[](size_t i) {
^
1 error generated.
It will be good if gcc also can give error with message that size_t undefined.
More information about the Gcc-bugs
mailing list