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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to