[llvm-bugs] [Bug 34529] New: <system_error> should include a definition for std::string

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Sep 8 11:22:07 PDT 2017


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

            Bug ID: 34529
           Summary: <system_error> should include a definition for
                    std::string
           Product: libc++
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: arthur.j.odwyer at gmail.com
                CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com

=====
#include <system_error>

int main() {
   std::error_condition x = std::errc(0);
   x.message();
}
=====

prog.cc:7:6: error: implicit instantiation of undefined template
'std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> >'
   x.message();
     ^
/opt/wandbox/clang-head/include/c++/v1/iosfwd:193:32: note: template is
declared here
    class _LIBCPP_TEMPLATE_VIS basic_string;
                               ^
1 error generated.


See https://wandbox.org/permlink/jqt5lpC3bEpqysEZ

My understanding is that once I've included <system_error> in my translation
unit, I should be able to call any method of a class defined in <system_error>
without getting weird compiler errors.
GCC/libstdc++ seems to handle this test program just fine.

The workaround is easy; I just #include <string> before trying to use
error_condition::message(). But I feel like I shouldn't have to work around
this; it should Just Work.

-- 
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/20170908/8b6ba7de/attachment-0001.html>


More information about the llvm-bugs mailing list