http://llvm.org/bugs/show_bug.cgi?id=9598
Summary: use of overloaded operator '[]' is ambiguous
Product: clang
Version: unspecified
Platform: PC
OS/Version: All
Status: NEW
Severity: normal
Priority: P
Component: C++
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
Created an attachment (id=6386)
--> (http://llvm.org/bugs/attachment.cgi?id=6386)
Test case
The attached code works fine in gcc and seem correct enough but fails with the
following errors using the clang++ compiler shipped with Xcode 4:
test.cpp:11:10: error: use of overloaded operator '[]' is ambiguous
return a["a"];
~^~~~
test.cpp:6:9: note: candidate function
double operator[](const std::string& str) { return 0.0; }
^
test.cpp:11:10: note: built-in candidate operator[](long, const char *)
return a["a"];
^
test.cpp:11:10: note: built-in candidate operator[](long, const restrict char
*)
test.cpp:11:10: note: built-in candidate operator[](long, const volatile char
*)
test.cpp:11:10: note: built-in candidate operator[](long, const volatile
restrict char *)
1 error generated.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- 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