This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/50921] New: GCC cannot find dependent conversion-function-id even if there's a using declaration for it


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]