diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e6a1d37e..a5d1df60 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -153,24 +153,24 @@ jobs: # environment_script: "C:/Program Files (x86)/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat", # } - # MSVC 2019 - - { - name: "MSVC 2022 / LLVM 14 @ Windows Code Coverage & Debug", - os: windows-2022, - build_type: Release, - cxx: "clang-cl.exe", - llvm_version: "14.0.0", - llvm_config: "current/bin/llvm-config.exe", - coverage: "Yes", - static: "Yes", - debug: "Yes", - tidy: "No", - run_tests: "No", - bin_name: "insights.exe", - archive_name: "insights-windows", - upload: "No", - environment_script: "C:/Program Files (x86)/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat", - } + # # MSVC 2019 + # - { + # name: "MSVC 2022 / LLVM 14 @ Windows Code Coverage & Debug", + # os: windows-2022, + # build_type: Release, + # cxx: "clang-cl.exe", + # llvm_version: "14.0.0", + # llvm_config: "current/bin/llvm-config.exe", + # coverage: "Yes", + # static: "Yes", + # debug: "Yes", + # tidy: "No", + # run_tests: "No", + # bin_name: "insights.exe", + # archive_name: "insights-windows", + # upload: "No", + # environment_script: "C:/Program Files (x86)/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat", + # } steps: - uses: actions/checkout@v2 diff --git a/CodeGenerator.cpp b/CodeGenerator.cpp index c2bfdcdd..4161a58d 100644 --- a/CodeGenerator.cpp +++ b/CodeGenerator.cpp @@ -53,7 +53,7 @@ static std::string AccessToStringWithColon(const AccessSpecifier& access) static std::string_view GetCastName(const CastKind castKind) { - if(is{castKind}.any_of(CastKind::CK_BitCast, CastKind::CK_IntegralToPointer)) { + if(is{castKind}.any_of(CastKind::CK_BitCast, CastKind::CK_IntegralToPointer, CastKind::CK_PointerToIntegral)) { return kwReinterpretCast; } diff --git a/InsightsUtility.h b/InsightsUtility.h index 71199ca3..1c5bfb5b 100644 --- a/InsightsUtility.h +++ b/InsightsUtility.h @@ -10,6 +10,7 @@ #include "llvm/ADT/STLExtras.h" +#include #include //----------------------------------------------------------------------------- diff --git a/tests/Issue512.cpp b/tests/Issue512.cpp new file mode 100644 index 00000000..7f0687d5 --- /dev/null +++ b/tests/Issue512.cpp @@ -0,0 +1,10 @@ +long long int charPtrToInt(const char* str) +{ + long long int a = (long long int)str; + return a; +} + +int main() { + const char* str = "123"; + charPtrToInt(str); +} diff --git a/tests/Issue512.expect b/tests/Issue512.expect new file mode 100644 index 00000000..05848096 --- /dev/null +++ b/tests/Issue512.expect @@ -0,0 +1,14 @@ +long long charPtrToInt(const char * str) +{ + long long a = reinterpret_cast(str); + return a; +} + + +int main() +{ + const char * str = "123"; + charPtrToInt(str); + return 0; +} +