accellera-official / systemc

SystemC Reference Implementation
https://systemc.org/overview/systemc/
Apache License 2.0
476 stars 152 forks source link

SystemC fails to build with clang 8 & libc++ 8 #5

Closed vanwinkeljan closed 9 months ago

vanwinkeljan commented 4 years ago
  1. SystemC version 2.3.3
  2. platform, compiler, flags 2.1. platform: Linux - Ubuntu 18.04.4 LTS 2.2. compiler: clang 8 + libc++ 8 2.3. flags: see point 4
  3. description of the problem SystemC fails to build with clang 8 and libc++ 8 due to an incorrect include of experimental/string_view in sc_string_view.h Note that experimental/string_view is not support anymore form libc++ 7 and onwards
  4. steps to reproduce the problem 4.1. mkdir build 4.2. CC=clang-8 CXX=clang++-8 CXXFLAGS="-stdlib=libc++" cmake .. -DCMAKE_CXX_STANDARD=14 4.3. make
  5. compile/runtime warnings and errors
    ...
    In file included from src/sysc/kernel/sc_simcontext.cpp:57:
    In file included from src/sysc/utils/sc_string_view.h:47:
    /usr/lib/llvm-8/bin/../include/c++/v1/experimental/string_view:18:3: warning: "<experimental/string_view> has been removed. Use <string_view> instead." [-W#warnings]
    # warning "<experimental/string_view> has been removed. Use <string_view> instead."
    ^
    ...
    In file included from src/sysc/kernel/sc_simcontext.cpp:57:
    src/sysc/utils/sc_string_view.h:62:9: error: no member named 'experimental' in namespace 'std'
    typedef SC_STRING_VIEW_NS_::string_view sc_string_view;
    ...
  6. code sample, not more than 100 lines to demonstrate the problem Not Applicable

Additional information:

Issue is caused at line 41 by the check for c++ version > c++14 https://github.com/accellera-official/systemc/blob/604182509559ae42c34e878f508bae7c18abbbd6/src/sysc/utils/sc_string_view.h#L40-L51

Best Regards, Jan

AndrewGoodrich commented 9 months ago

3.0.0 has a minimum of C++17, so all this conditional inclusion code has been removed. This issue can be closed.