[llvm-bugs] [Bug 25074] New: clang failed to look up base class template member functions brought in scope via using

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Oct 6 07:14:39 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=25074

            Bug ID: 25074
           Summary: clang failed to look up base class template member
                    functions brought in scope via using
           Product: clang
           Version: 3.5
          Hardware: All
                OS: Solaris
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: hui.li at me.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org
    Classification: Unclassified

#include <type_traits>
#include <iostream>

template < typename >
struct base
{
   template < typename T >
   typename std::enable_if<std::is_integral<T>::value>::type
   foo(T)
   {
      std::cout << "base::foo" << std::endl;
   }
};

struct derived 
 : base<int>
{
   using base<int>::foo;

   template < typename T >
   typename std::enable_if<not std::is_integral<T>::value>::type
   foo(T)
   {
      std::cout << "derived::foo" << std::endl;
   }
};

int main()
{
   derived d;
   d.foo(0);
}

Compile error from clang3.5:
t.cpp:31:6: error: no matching member function for call to 'foo'
   d.foo(0);
   ~~^~~
t.cpp:21:28: note: candidate template ignored: disabled by 'enable_if' [with T
= int]
   typename std::enable_if<not std::is_integral<T>::value>::type
                           ^
1 error generated.
lih at apxdevbal827[~] (1040)$
/opt/ci1/toolchain/tc10b/sles11sp2_gcc-4.8.3_x86-64/llvm-3.5.0/bin/clang++
-std=c++14 -I
/opt/ci1/toolchain/tc10b/sles11sp2_gcc-4.8.3_x86-64/gcc-4.8.3/include/c++/4.8.3/
t.cpp
t.cpp:31:6: error: no matching member function for call to 'foo'
   d.foo(0);
   ~~^~~
t.cpp:21:28: note: candidate template ignored: disabled by 'enable_if' [with T
= int]
   typename std::enable_if<not std::is_integral<T>::value>::type
                           ^
1 error generated.

-- 
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/20151006/65b0adc4/attachment-0001.html>


More information about the llvm-bugs mailing list