This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/78623] New: non-dependent name treated as if it were dependent, requiring use of template keyword
- From: "barry.revzin at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 30 Nov 2016 21:23:08 +0000
- Subject: [Bug c++/78623] New: non-dependent name treated as if it were dependent, requiring use of template keyword
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78623
Bug ID: 78623
Summary: non-dependent name treated as if it were dependent,
requiring use of template keyword
Product: gcc
Version: 6.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: barry.revzin at gmail dot com
Target Milestone: ---
This example fails to compile on the marked line - gcc requires me to write
result.template foo<void>(), which shouldn't be necessary. Nothing here is
dependent.
If I declared result as an X rather than with auto, the code compiles fine.
struct X {
template <class T>
void foo();
};
struct Base {
X get();
};
template <class >
struct Derived : Base
{
void foo() {
auto result = Base::get();
result.foo<void>(); // (*)
}
};
template struct Derived<int>;