This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
G++ refuses to compile simple, looking good code
- From: Luchezar Belev <lukcho at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Fri, 14 Jun 2013 12:30:56 +0300
- Subject: G++ refuses to compile simple, looking good code
Hi,
i'm not a c++/template guru and i can't decide if this is really a
valid code or i have encountered a gcc bug:
------------------------------
template <class T> struct A {
void *p;
};
template <class T> struct B : A<T> {
void *foo() { return p; }
};
------------------------------
g++ says "error: 'p' was not declared in this scope".
microsoft's compiler is happy with the same code.
Can anyone help?