[LLVMbugs] [Bug 17838] New: operator[] should take precidence over builtin string []

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Nov 7 07:55:01 PST 2013


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

            Bug ID: 17838
           Summary: operator[] should take precidence over builtin string
                    []
           Product: clang
           Version: 3.2
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: war1025 at gmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 11497
  --> http://llvm.org/bugs/attachment.cgi?id=11497&action=edit
Test file.

The attached code implements the int() operator as well as
operator[](std::string).

The following snippet:
Test a;
a["hello"];

compiles on gcc, using the operator[] overload.
On clang, it complains of an ambiguous call. It seems that if there is an
operator[] available, then clang should choose that option rather than thinking
it is an index into a string.

-- 
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/20131107/f99f4a77/attachment.html>


More information about the llvm-bugs mailing list