https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65969
Bug ID: 65969 Summary: typename allowed in using declaration of non-types names Product: gcc Version: 5.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: bitte.keine.werbung.einwerfen at googlemail dot com Target Milestone: --- Created attachment 35438 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35438&action=edit various cases of using declarations of non-types The standard draft states for using declarations in 7.3.3/19: --- If a using-declaration uses the keyword typename and specifies a dependent name (14.6.2), the name introduced by the using-declaration is treated as a typedef-name --- However, if the 'nested-name-specifier unqualified-id' names a non-type, a typedef on this name would be invalid. Nevertheless, g++-5.1 issues no error for the following code snippet: <<< SNIP template < typename T > class BaseTemplate { protected: T member; }; template < typename T > struct SubTypename : protected BaseTemplate< T > { using typename BaseTemplate< T >::member; // clang and icpc fail here }; >>> SNAP More related cases are in the attached file. The standard is not 100% concise about the usage of typename in using declarations. However, clang and icpc both complain about misplaced typenames. What do the experts think? related: 55664 I wrote on stackoverflow, but I'm actually unsure if I'm really right: http://stackoverflow.com/questions/25944000/c-using-declaration-with-typename-in-inheriting-constructors/29965088#29965088