[Bug c++/59383] typedef propagation with template base class using the same name is wrong
naup at sfr dot fr
gcc-bugzilla@gcc.gnu.org
Thu Dec 18 10:10:00 GMT 2014
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59383
naup at sfr dot fr changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |naup at sfr dot fr
--- Comment #1 from naup at sfr dot fr ---
This is the same behaviour as in invalid bug 50418.
Alas, no diagnostic is required, says the standard, and gcc interpretes
**differently** the typedef type wheither the base is template or not.
NON TEMPLATE BASE
struct A
{
typedef A this_type;
};
template <class T> struct B : public A
{
typedef this_type parent; // this_type is taken as **A** (current context)
typedef B this_type; // the two lines make B ill-formed
};
TEMPLATE BASE
template <class T> struct A
{
typedef A this_type;
};
template <class T> struct B : public A<T>
{
typedef this_type parent; // this_type is taken as **B** (after-next-line
context)
typedef B this_type; // the two lines make B ill-formed
};
More information about the Gcc-bugs
mailing list