[llvm-bugs] [Bug 39076] New: "no matching constructor" when "using" template base class constructor

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Sep 25 08:47:16 PDT 2018


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

            Bug ID: 39076
           Summary: "no matching constructor" when "using" template base
                    class constructor
           Product: clang
           Version: 7.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: duvan.llvm at gmail.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org

Created attachment 20920
  --> https://bugs.llvm.org/attachment.cgi?id=20920&action=edit
Small source code file to reproduce the problem.

When compiling the attached file 

  bash> clang++ --std=c++17 bug.C

clang errors out with:

bug.C:14:15: error: no matching constructor for initialization of 'Sub<double>'
  Sub<double> sub(nullptr);
              ^   ~~~~~~~
bug.C:8:8: note: candidate constructor (the implicit copy constructor) not
viable: no known conversion from 'nullptr_t' to 'const Sub<double>' for 1st
argument
struct Sub : public Base<T, T> {
       ^
bug.C:8:8: note: candidate constructor (the implicit move constructor) not
viable: no known conversion from 'nullptr_t' to 'Sub<double>' for 1st argument
struct Sub : public Base<T, T> {
       ^
bug.C:8:8: note: candidate constructor (the implicit default constructor) not
viable: requires 0 arguments, but 1 was provided
1 error generated.

It seems the base class constructor Base(double*) is not picked up despite the 

  using base = Base<T, T>;
  using typename base::Base;

Works in gcc 8.2.0.

-- 
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/20180925/94039ac8/attachment.html>


More information about the llvm-bugs mailing list