[llvm-bugs] [Bug 30476] New: clang silently accepts syntactically wrong conversion operators

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Sep 21 07:57:45 PDT 2016


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

            Bug ID: 30476
           Summary: clang silently accepts syntactically wrong conversion
                    operators
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: philip.pfaffe at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Consider this example:

#include <string>
class Foo {
  const operator std::string() const { return "A"; }
};

Clang compiles this without a warning or error, silently ignoring the first
garbage const. MSVC and GCC throw an error on this, and so should clang.

-- 
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/20160921/b3d46ccf/attachment.html>


More information about the llvm-bugs mailing list