[PATCH] D72910: Fix a bug with clang with object destructor, while skipping object initialization - make clang crash

ido via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 17 03:39:08 PST 2020


ykfre added a comment.

In D72910#1826108 <https://reviews.llvm.org/D72910#1826108>, @dim wrote:

> Eh, no it does not crash clang, at least not here?  Instead it gives you a compile error, as it should:
>
>   cleanup.cpp:15:5: error: cannot jump from this goto statement to its label
>                   goto clean_up;
>                   ^
>   cleanup.cpp:20:7: note: jump bypasses variable initialization
>     int i = 0;
>         ^
>   cleanup.cpp:18:4: note: jump bypasses variable initialization
>           A a;
>             ^
>   1 error generated.
>
>
> (This is with clang 9.0.1 on FreeBSD. I haven't tried on Windows.)


Actually I see it only crashes clang-cl, and not clang, probably clang-cl fucks something up.
The command line is -

1. Original command:  "C:\\Program Files\\LLVM\\bin\\clang-cl.exe" "-cc1" "-triple" "i386-pc-windows-msvc19.24.28314" "-emit-obj" "-mrelax-all" "-mincremental-linker-compatible" "-disable-free" "-disable-llvm-verifier" "-discard-value-names" "-main-file-name" "main2.cpp" "-mrelocation-model" "static" "-mthread-model" "posix" "-mdisable-fp-elim" "-relaxed-aliasing" "-fmath-errno" "-masm-verbose" "-mconstructor-aliases" "-target-cpu" "pentium4" "-mllvm" "-x86-asm-syntax=intel" "-D_DEBUG" "-D_MT" "-D_DLL" "--dependent-lib=msvcrtd" "--dependent-lib=oldnames" "-fms-volatile" "-fdefault-calling-conv=cdecl" "-fdiagnostics-format" "msvc" "-gcodeview" "-debug-info-kind=limited" "-v" "-coverage-notes-file" "C:\\Users\\IDO\\source\\repos\\Project11\\Project11\\main2.gcno" "-resource-dir" "C:\\Program Files\\LLVM\\lib\\clang\\9.0.0" "-D" "_DEBUG" "-D" "_CONSOLE" "-D" "_UNICODE" "-D" "UNICODE" "-internal-isystem" "C:\\Program Files\\LLVM\\lib\\clang\\9.0.0\\include" "-internal-isystem" "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\VC\\Tools\\MSVC\\14.24.28314\\include" "-internal-isystem" "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\VC\\Tools\\MSVC\\14.24.28314\\atlmfc\\include" "-internal-isystem" "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\VC\\Auxiliary\\VS\\include" "-internal-isystem" "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.18362.0\\ucrt" "-internal-isystem" "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.18362.0\\um" "-internal-isystem" "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.18362.0\\shared" "-internal-isystem" "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.18362.0\\winrt" "-internal-isystem" "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.18362.0\\cppwinrt" "-internal-isystem" "C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.8\\Include\\um" "-O0" "-WCL4" "-Werror" "-fdeprecated-macro" "-fdebug-compilation-dir" "C:\\Users\\IDO\\source\\repos\\Project11\\Project11" "-ferror-limit" "19" "-fmessage-length" "0" "-fno-use-cxa-atexit" "-fms-extensions" "-fms-compatibility" "-fms-compatibility-version=19.24.28314" "-std=c++14" "-fdelayed-template-parsing" "-fobjc-runtime=gcc" "-fno-caret-diagnostics" "-fdiagnostics-show-option" "-faddrsig" "-o" "Debug\\main2.obj" "-x" "c++" "main2.cpp"


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D72910/new/

https://reviews.llvm.org/D72910





More information about the cfe-commits mailing list