[llvm-bugs] [Bug 48545] New: Access failure to own private inherited constructor for prvalue direct-initialization

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Dec 17 10:05:04 PST 2020


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

            Bug ID: 48545
           Summary: Access failure to own private inherited constructor
                    for prvalue direct-initialization
           Product: clang
           Version: 11.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++17
          Assignee: unassignedclangbugs at nondot.org
          Reporter: ed at catmur.co.uk
                CC: blitzrakete at gmail.com, erik.pilkington at gmail.com,
                    llvm-bugs at lists.llvm.org, richard-llvm at metafoo.co.uk

struct B {
    void f();
private:
    B(int, int = 0);
};
struct D : B { using B::B; };
void B::f() {
    auto a = D{0};
    auto b = D(0);
    auto c = D(0, 0);
    D x{0};
    D y(0);
    D z(0, 0);
}

Accepts: b, x, y, z. Rejects: a, c.

MSVC accepts all in C++17 mode, rejects all in C++14 mode, which apparently [1]
is due to their interpretation of the C++14 as-published wording [2].

GCC accepts all since 7.1, previously rejects all.

1. https://stackoverflow.com/a/65327682/567292
2. http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0136r1.html

-- 
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/20201217/95b80b0a/attachment.html>


More information about the llvm-bugs mailing list