[llvm-bugs] [Bug 35886] Inconsistent narrowing errors

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jan 10 19:12:25 PST 2018


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

Richard Smith <richard-llvm at metafoo.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
                 CC|                            |richard-llvm at metafoo.co.uk
         Resolution|---                         |INVALID

--- Comment #3 from Richard Smith <richard-llvm at metafoo.co.uk> ---
(In reply to Shane from comment #2)
> While the compiler defaults used in that particular build are the reason for
> seeing the results I reported as errors and not warnings, it doesn't change
> the inconsistent results that I have reported.

Whether a conversion is or is not narrowing, and whether narrowing is permitted
or ill-formed, is specified by the C++ standard. You're not alone in finding it
both to be inconsistent and to reject completely reasonable code; that's why
Clang provides a flag to turn off the error.

For a description of the rules, see the standard text at
http://eel.is/c++draft/dcl.init.list#7 or the explanation at
http://en.cppreference.com/w/cpp/language/list_initialization

-- 
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/20180111/987f338a/attachment-0001.html>


More information about the llvm-bugs mailing list