[llvm-bugs] [Bug 40385] New: use absolute include paths

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Jan 20 03:26:41 PST 2019


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

            Bug ID: 40385
           Summary: use absolute include paths
           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

G++ doesn't show such long paths, but clang++ does

It would be best if these could be converted to absolute paths immediately with
realpath() so that only absolute paths appeared in errors/warnings later in
output.

Observed:
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/basic_string.h

Expected:
/usr/include/c++/8/bits/basic_string.h



Example program :-


#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/f73762c8/attachment-0001.html>


More information about the llvm-bugs mailing list