<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - use absolute include paths"
   href="https://bugs.llvm.org/show_bug.cgi?id=40385">40385</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>use absolute include paths
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>C++
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>jg@jguk.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>blitzrakete@gmail.com, dgregor@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>