[Bug c++/87910] New: Missing typename/template not diagnosed
mpolacek at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Nov 6 20:36:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87910
Bug ID: 87910
Summary: Missing typename/template not diagnosed
Product: gcc
Version: 9.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: mpolacek at gcc dot gnu.org
Target Milestone: ---
While working on P0634 I noticed that the following testcase is accepted while
it probably shouldn't be:
template<typename T> struct A {
template<typename U> struct B;
template<typename U> using C = U;
};
template<typename T> A<T>::B<T> f1();
template<typename T> A<T>::C<T> f2();
The dependent names "A<T>::B<T>" should be prefixed by the typename keyword,
and the template keyword should come after ::.
With P0634 that typename will no longer be required[*] but I think it still
requires "::template".
[*] it is a decl-specifier of the decl-specifier-seq of a simple-declaration or
a function-definition in namespace scope
More information about the Gcc-bugs
mailing list