[Bug c++/34810] accepts invalid dependent(?) type in template class method

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Dec 7 02:55:03 GMT 2021


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=34810

--- Comment #11 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Someone who has better understanding of the C++ standard should answer the
question if this is valid or not because I don't understand all of the specific
rules rules which are in play here. Especially when there has been some defect
reports in this area before even.

The question is:
    class B { };
    class A: public B {
        A::B ab;       // B is the inherited injected B
    };
typename A::A a;

vs:
class B { };
class A: public B {
  A::B ab;       // B is the inherited injected B
};
struct A::A a;

CWG 318 clearifies the struct case but I don't see why typename would be
handled here any different from struct case.


More information about the Gcc-bugs mailing list