[llvm-bugs] [Bug 51662] New: Conversion to ambiguous/inaccessible rvalue base is valid in evaluated context

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Aug 28 14:46:38 PDT 2021


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

            Bug ID: 51662
           Summary: Conversion to ambiguous/inaccessible rvalue base is
                    valid in evaluated context
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Keywords: accepts-invalid
          Severity: enhancement
          Priority: P
         Component: C++2a
          Assignee: unassignedclangbugs at nondot.org
          Reporter: johelegp at gmail.com
                CC: blitzrakete at gmail.com, erik.pilkington at gmail.com,
                    johelegp at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

See https://godbolt.org/z/5744Ee69o. See also
https://bugs.llvm.org/show_bug.cgi?id=37691.
```C++
template <class To, class From>
concept is_static_castable = requires(From&& (*from)()) {
static_cast<To>(from()); };

struct B { };
struct D : B { };
struct D2 : D , B { };
struct D3 : private B { };

void f()
{
  D2 d2;
  (void)static_cast<B&&>(d2); // no error
  D3 d3;
  (void)static_cast<B&&>(d3); // no error
}
```

-- 
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/20210828/98a7995d/attachment-0001.html>


More information about the llvm-bugs mailing list