| Issue |
87944
|
| Summary |
C++ parser crash with too many user-defined literals in an _expression_
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
christinabrien
|
[clang-crash.zip](https://github.com/llvm/llvm-project/files/14899001/clang-crash.zip)
The C++ parser crashes with "Illegal instruction" when compiling a C++ file with a very long _expression_ consisting of user-defined literals. My use-case is in creating a bitstring from smaller bitstring literals.
I have used creduce to produce a minimal test case; removing a single _expression_ avoids the crash. I believe this is valid C++ and is compiled correctly by GCC 13.2.0. I have included the creduce interestingness test.
```
christina@Orange:~/pi/all/top/clash/minimised$ ./test.sh
0
christina@Orange:~/pi/all/top/clash/minimised$ ./compile.sh
./compile.sh: line 4: 43889 Illegal instruction: 4 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" "-cc1" "-triple" "x86_64-apple-macosx12.0.0" "-Wundef-prefix=TARGET_OS_" "-Wdeprecated-objc-isa-usage" "-Werror=deprecated-objc-isa-usage" "-Werror=implicit-function-declaration" "-emit-obj" "--mrelax-relocations" "-disable-free" "-clear-ast-before-backend" "-disable-llvm-verifier" "-discard-value-names" "-main-file-name" "AdaptationParameterSet.test.c++" "-mrelocation-model" "pic" "-pic-level" "2" "-mframe-pointer=all" "-mllvm" "-extra-vectorizer-passes" "-fno-strict-return" "-fno-rounding-math" "-funwind-tables=2" "-target-sdk-version=13.1" "-fvisibility-inlines-hidden-static-local-var" "-target-cpu" "skylake" "-debug-info-kind=standalone" "-dwarf-version=4" "-debugger-tuning=lldb" "-target-linker-version" "820.1" "-skip-unused-modulemap-deps" "-sys-header-deps" "-stdlib=libc++" "-O3" "-Werror" "-Wno-c++11-narrowing" "-Wno-ignored-attributes" "-Wno-c++20-extensions" "-Wno-c++17-extensions" "-Wno-reorder-init-list" "-Wno-implicit-int-float-conversion" "-Wno-c99-designator" "-Wno-final-dtor-non-final-class" "-Wno-extra-semi-stmt" "-Wno-misleading-indentation" "-Wno-quoted-include-in-framework-header" "-Wno-implicit-fallthrough" "-Wno-enum-enum-conversion" "-Wno-enum-float-conversion" "-Wno-elaborated-enum-base" "-Wno-reserved-identifier" "-Wno-gnu-folding-constant" "-Wno-cast-function-type" "-Wno-bitwise-instead-of-logical" "-std=c++14" "-fdeprecated-macro" "-fdebug-compilation-dir=/Users/christina/pi/all/top" "-ferror-limit" "19" "-stack-protector" "1" "-fstack-check" "-mdarwin-stkchk-strong-link" "-fblocks" "-fencode-extended-block-signature" "-fregister-global-dtors-with-atexit" "-fgnuc-version=4.2.1" "-fno-cxx-modules" "-fcxx-exceptions" "-fexceptions" "-fmax-type-align=16" "-fcommon" "-vectorize-loops" "-vectorize-slp" "-clang-vendor-feature=+messageToSelfInClassMethodIdReturnType" "-clang-vendor-feature=+disableInferNewAvailabilityFromInit" "-clang-vendor-feature=+disableNonDependentMemberExprInCurrentInstantiation" "-fno-odr-hash-protocols" "-clang-vendor-feature=+enableAggressiveVLAFolding" "-clang-vendor-feature=+revert09abecef7bbf" "-clang-vendor-feature=+thisNoAlignAttr" "-clang-vendor-feature=+thisNoNullAttr" "-mllvm" "-disable-aligned-alloc-awareness=1" "-D__GCC_HAVE_DWARF2_CFI_ASM=1" "-x" "c++" "too-many-literals-in-_expression_.cpp"
christina@Orange:~/pi/all/top/clash/minimised$ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang --version
Apple clang version 14.0.0 (clang-1400.0.29.202)
Target: x86_64-apple-darwin21.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs