[LLVMbugs] [Bug 18777] New: Explicit conversion operator ignored when passed as argument to new expression

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Feb 8 09:44:45 PST 2014


http://llvm.org/bugs/show_bug.cgi?id=18777

            Bug ID: 18777
           Summary: Explicit conversion operator ignored when passed as
                    argument to new expression
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: andersca at icloud.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

struct S {
  explicit operator bool() const;
};

void f(S s)
{
  new int (s);
}

This compiles fine with clang. GCC gives:

/tmp/gcc-explorer-compiler11416-10864-1s0ip2y/example.cpp: In function ‘void
f(S)’:

7 : error: invalid user-defined conversion from ‘S’ to ‘int’ [-fpermissive]

new int (s);

-- 
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/20140208/0398e116/attachment.html>


More information about the llvm-bugs mailing list