[LLVMbugs] [Bug 22443] New: Issues with using-declaration in class

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Feb 3 01:47:40 PST 2015


http://llvm.org/bugs/show_bug.cgi?id=22443

            Bug ID: 22443
           Summary: Issues with using-declaration in class
           Product: clang
           Version: 3.5
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: d.v.a at ngs.ru
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Sample code:

template<class V>
struct B
{
     template<class T>
     T f() { return T(); }
};
template<class V>
struct D : public B<V>
{
    typedef    B<V> base;

    using base::f;
    template<class T>
    void f(T &v) { v = f<T>(); }
};

int main()
{
    int n  ;
    D<void>().f(n);
}


Error message:

14 : error: no matching member function for call to 'f'

void f(T &v) { v = f<T>(); }

^~~~

20 : note: in instantiation of function template specialization 'D::f'
requested here

D<void>().f(n);

^

14 : note: candidate function template not viable: requires single argument
'v', but no arguments were provided

void f(T &v) { v = f<T>(); }

^


With GCC this works well. I suppose using-declaration must bring all
identifiers from base class.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150203/f030f631/attachment.html>


More information about the llvm-bugs mailing list