This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/66350] typename should be forbidden in inhering constructors
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 05 Jun 2015 13:18:21 +0000
- Subject: [Bug c++/66350] typename should be forbidden in inhering constructors
- Auto-submitted: auto-generated
- References: <bug-66350-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66350
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Also, "using typename Base<T>::name;" would usually re-declare a type name in
the derived class' scope, but that's not what's happening here. It's
introducing inheriting constructors, not a type.
7.3.3 [namespace.udecl]/19 says:
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 (7.1.3).
and we definitely don't want it to be treated as a typedef-name, so "typename"
must not be used for an inheriting constructor.