fix a llvm compilation error with llvm16
authorYonghong Song <yhs@fb.com>
Wed, 10 Aug 2022 07:13:43 +0000 (00:13 -0700)
committerKarol Lewandowski <k.lewandowsk@samsung.com>
Thu, 22 Feb 2024 14:17:55 +0000 (15:17 +0100)
commit7519dc83e35f731859ca1818cd4d764fa45ae06a
tree8dd0a07f79d775c02a69291b6d76aa5dd6287621
parent0f5a4bedc707fc67b6322e21d01ec08fb72f2587
fix a llvm compilation error with llvm16

LLVM16 patch
  https://github.com/llvm/llvm-project/commit/b4e9977fc18405d4a11cbaf1975bcadbf75920b8
caused bcc build failure like below:

 from /.../bcc/src/cc/frontends/clang/b_frontend_action.cc:23:
 /.../llvm-project/llvm/build/install/include/llvm/ADT/StringRef.h:96:54: error: expected β€˜)’ before β€˜Str’
     /*implicit*/ constexpr StringRef(std::string_view Str)
                                     ~                ^~~~
                                                      )
 /.../llvm-project/llvm/build/install/include/llvm/ADT/StringRef.h:239:14: error: expected type-specifier
     operator std::string_view() const {
              ^~~

LLVM build itself now is done with c++17. Let us also compile with c++17
if bcc is built with llvm16.

Signed-off-by: Yonghong Song <yhs@fb.com>
CMakeLists.txt