This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/16375] New: typeof() in class definition
- From: "nowak at xpam dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Jul 2004 20:53:12 -0000
- Subject: [Bug c++/16375] New: typeof() in class definition
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
class A {
public:
int a;
typeof(a) b;
};
int main() {
class A a;
a.b = 0;
return a.b;
}
nowak@debian:/usr/home/nowak$ g++ -Wall test.cpp
test.cpp:4: error: invalid use of member `A::a'
test.cpp:4: error: ISO C++ forbids declaration of `b' with no type
or with 'this'
class A {
public:
int a, b;
typeof(*this)* pPrev;
typeof(*this)* pNext;
};
int main() {
class A a;
a.b = 0;
return a.b;
}
nowak@debian:/usr/home/nowak$ g++ -Wall test.cpp
test.cpp:4: error: invalid use of `this' at top level
test.cpp:4: error: ISO C++ forbids declaration of `pPrev' with no type
test.cpp:5: error: invalid use of `this' at top level
test.cpp:5: error: ISO C++ forbids declaration of `pNext' with no type
--
Summary: typeof() in class definition
Product: gcc
Version: 3.3.4
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: nowak at xpam dot de
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16375