[llvm-bugs] [Bug 30266] New: [CWG 909] C-style cast necessitating static_cast -> const_cast fails for conversion operator

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Sep 3 02:29:16 PDT 2016


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

            Bug ID: 30266
           Summary: [CWG 909] C-style cast necessitating static_cast ->
                    const_cast fails for conversion operator
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++14
          Assignee: unassignedclangbugs at nondot.org
          Reporter: r.hl at gmx.net
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

struct S {
  operator const int* ();
};

void f(S& s)  {
  const_cast<int*>(static_cast<const int*>(s));  // #1
  (int*) s;  // #2
}

#2 is intended to be valid (see core issue 909), yet fails to compile.

-- 
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/20160903/65dd6825/attachment.html>


More information about the llvm-bugs mailing list