[llvm-bugs] [Bug 43004] New: Variant constructors forbid narrowing conversions

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Aug 15 04:44:18 PDT 2019


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

            Bug ID: 43004
           Summary: Variant constructors forbid narrowing conversions
           Product: libc++
           Version: 9.0
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: David.Truby at arm.com
                CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com

Created attachment 22377
  --> https://bugs.llvm.org/attachment.cgi?id=22377&action=edit
Narrowing conversion in variant constructor doesn't compile

I've attached a very simple file that builds with libc++ 8 and libstdc++ but
fails to build with libc++ 9. I've narrowed the change down to this commit
implementing P0608R3: https://reviews.llvm.org/D44865.
It appears that the paper forbids all narrowing conversions when constructing a
variant, is my understanding of that correct? If so it seems that this changes
behaviour in a way that breaks backwards compatibility even for code that isn't
defective and is valid C++17.

-- 
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/20190815/573f45a2/attachment-0001.html>


More information about the llvm-bugs mailing list