This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/50921] New: GCC cannot find dependent conversion-function-id even if there's a using declaration for it
- From: "schaub.johannes at googlemail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 30 Oct 2011 13:26:01 +0000
- Subject: [Bug c++/50921] New: GCC cannot find dependent conversion-function-id even if there's a using declaration for it
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50921
Bug #: 50921
Summary: GCC cannot find dependent conversion-function-id even
if there's a using declaration for it
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: schaub.johannes@googlemail.com
The following code should compile but doesn't.
------- snip
template<typename T>
struct Type { int x; };
template<typename T>
struct Base {
operator Type<int>();
};
template<typename T>
struct Derived : Base<T> {
using Base<T>::operator Type<T>;
void f() {
int x = operator Type<T>().x;
(void) x;
}
};
int main() {
Derived<int> d;
d.f();
}
------- snap
Error:
------- snip
main1.cpp:13:30: error: there are no arguments to 'operator Type<T>' that
depend on a template parameter, so a declaration of 'operator Type<T>' must be
available
------- snap
The function call is dependent by the dependent function name itself, it
doesn't need dependent call arguments in this case in order to be dependent.