[llvm-bugs] [Bug 45012] New: clang accepts a call to an ambiguous inherited constructor in some cases

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Feb 24 16:25:22 PST 2020


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

            Bug ID: 45012
           Summary: clang accepts a call to an ambiguous inherited
                    constructor in some cases
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: richard-llvm at metafoo.co.uk
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

Testcase:

struct A { A(int); };
struct B : virtual A { using A::A; };
struct C : A, B { using A::A; using B::B; };
C c(123);

Clang accepts and passes the 123 on to the constructors of both A base
subobjects. This code is ill-formed under [class.inhctor.init]p2:

> If the constructor was inherited from multiple base class subobjects of type B, the program is ill-formed.

-- 
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/20200225/2a41646b/attachment-0001.html>


More information about the llvm-bugs mailing list