[LLVMbugs] [Bug 18240] New: С++11 standard compliance parts and 8.5.15

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Dec 13 06:44:18 PST 2013


            Bug ID: 18240
           Summary: С++11 standard compliance parts and 8.5.15
           Product: new-bugs
           Version: 3.3
          Hardware: PC
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: msnkipa at mail.ru
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

For the code

struct A
      explicit operator bool() { return true; }

int main()
        A a;
    bool b { a };  // BUG or Error here??

I have error:
error: no viable conversion from 'A' to 'bool'

but part of the C++11 standard states that "explicit operator bool()"
will be (and must be) used in the direct initialization, and according to the
part 8.5.15 of the C++11 standard "bool b{a}" is a direct initialization of the
b. So is it a bug or I miss something?

GCC 4.8.2 accept such code without error.

I use clang++ under Mac OS X (clang++ --version says: Apple LLVM version 5.0
(clang-500.2.79) (based on LLVM 3.3svn))

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/20131213/450070b4/attachment.html>

More information about the llvm-bugs mailing list