[llvm-bugs] [Bug 40384] New: __cxx11 shouldn't be displayed
via llvm-bugs
llvm-bugs at lists.llvm.org
Sun Jan 20 03:20:24 PST 2019
https://bugs.llvm.org/show_bug.cgi?id=40384
Bug ID: 40384
Summary: __cxx11 shouldn't be displayed
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: C++
Assignee: unassignedclangbugs at nondot.org
Reporter: jg at jguk.org
CC: blitzrakete at gmail.com, dgregor at apple.com,
erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
richard-llvm at metafoo.co.uk
I know __cxx11 was introduced as ABI changed, but it doesn't need to be shown
to users. Can that be eliminated?
#include <string>
int main()
{
std::string str("hello ");
std::size_t s = str.find(" ");
str.erase(s, str.end());
}
Current output from my clang 6, which appears similar to clang trunk on
godbolt.org
$ clang++ -Wall -o stl_string stl_string.cpp
stl_string.cpp:7:9: error: no matching member function for call to 'erase'
str.erase(s, str.end());
~~~~^~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/basic_string.h:1789:7:
note: candidate
function not viable: no known conversion from
'std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >::iterator' (aka '__normal_iterator<char *,
std::__cxx11::basic_string<char> >')
to 'std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >::size_type'
(aka 'unsigned long') for 2nd argument
erase(size_type __pos = 0, size_type __n = npos)
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/basic_string.h:1827:7:
note: candidate
function not viable: no known conversion from 'std::size_t' (aka
'unsigned long') to
'std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >::__const_iterator' (aka
'__normal_iterator<const char *, std::__cxx11::basic_string<char> >') for
1st argument
erase(__const_iterator __first, __const_iterator __last)
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/basic_string.h:1808:7:
note: candidate
function not viable: requires single argument '__position', but 2
arguments were provided
erase(__const_iterator __position)
^
1 error generated.
--
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/20190120/ccd6ba79/attachment.html>
More information about the llvm-bugs
mailing list