On May 22, 10:17 pm, Steffen Hampel <steffen.ham... @s2000.tu-
chemnitz.dewrot e:
class Cfoo {
class Innerfoo;
typedef Innerfoo::Type1 Type1; // error: use of undefined type
Cfoo::Innerfoo: :Type1 bar; // error: use of undefined type
};
class Cfoo::Innerfoo {
typedef int Type1;
};
My understanding of the standard was that you can use
undefined types in declarations.
You can never use an undeclared symbol, period. There are
certain contexts where you can use an incomplete type, but the
symbol naming the type must be in scope. (In the first case
above, an incomplete type would be acceptable; in the second
no.)
The GCC agrees (no errors) but the VC++ compiler doesn't
(error messages as above).
The code is definitely wrong, and I get an error from both g++
and Sun CC.
--
James Kanze (GABI Software) email:ja******* **@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientier ter Datenverarbeitu ng
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34