<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/128384>128384</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            __has_embed: Assertion `Length < Tok.getLength() && "NeedsCleaning flag set on token that didn't need cleaning!"' failed.
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          hubert-reinterpretcast
      </td>
    </tr>
</table>

<pre>
    With an assertions-enabled build, an assertion failure is observed for a valid use of `__has_embed` which uses line splicing. Compiler Explorer link: https://godbolt.org/z/xKc5Txa4n

### Source (`<stdin>`)
```cpp
#if __has_embed(__FILE__\
)
int
#else
int
#endif
main() {}
```

### Compiler Invocation
```
clang++ -E -Wall -Wextra -pedantic -v -xc++ -
```

### Actual Compiler Output
```
clang version 21.0.0git (https://github.com/llvm/llvm-project.git 5f8da7e7738f043dbde447e48622e9b2afb5ba92)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/compiler-explorer/clang-assertions-trunk-20250222/bin
Build config: +assertions
Found candidate GCC installation: /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.1
Selected GCC installation: /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.1
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
clang++: warning: argument unused during compilation: '-S' [-Wunused-command-line-argument]
 (in-process)
 "/opt/compiler-explorer/clang-assertions-trunk-20250222/bin/clang-21" -cc1 -triple x86_64-unknown-linux-gnu -E -disable-free -clear-ast-before-backend -main-file-name example.cpp -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debug-info-kind=constructor -dwarf-version=4 -debugger-tuning=gdb -fdebug-compilation-dir=/app -v -fcoverage-compilation-dir=/app -resource-dir /opt/compiler-explorer/clang-assertions-trunk-20250222/lib/clang/21 -internal-isystem /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.1/../../../../include/c++/15.0.1 -internal-isystem /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.1/../../../../include/c++/15.0.1/x86_64-linux-gnu -internal-isystem /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.1/../../../../include/c++/15.0.1/backward -internal-isystem /opt/compiler-explorer/clang-assertions-trunk-20250222/lib/clang/21/include -internal-isystem /usr/local/include -internal-isystem /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.1/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -Wall -Wextra -pedantic -fdeprecated-macro -ferror-limit 19 -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fcxx-exceptions -fexceptions -fcolor-diagnostics -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /app/output.s -x c++ <source>
clang -cc1 version 21.0.0git based upon LLVM 21.0.0git default target x86_64-unknown-linux-gnu
ignoring nonexistent directory "/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.1/../../../../x86_64-linux-gnu/include"
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
 /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.1/../../../../include/c++/15.0.1
 /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.1/../../../../include/c++/15.0.1/x86_64-linux-gnu
 /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.1/../../../../include/c++/15.0.1/backward
 /opt/compiler-explorer/clang-assertions-trunk-20250222/lib/clang/21/include
 /usr/local/include
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
clang++: /root/llvm-project/clang/lib/Lex/Lexer.cpp:368: size_t getSpellingSlow(const clang::Token&, const char*, const clang::LangOptions&, char*): Assertion `Length < Tok.getLength() && "NeedsCleaning flag set on token that didn't need cleaning!"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/clang++ -gdwarf-4 -g -o /app/output.s -fverbose-asm -S --gcc-toolchain=/opt/compiler-explorer/gcc-snapshot -fcolor-diagnostics -fno-crash-diagnostics -E -Wall -Wextra -pedantic -v <source>
 #0 0x0000000003e46cb8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3e46cb8)
 #1 0x0000000003e44974 llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3e44974)
 #2 0x0000000003d90d78 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
 #3 0x000071ac1de42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x000071ac1de969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #5 0x000071ac1de42476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #6 0x000071ac1de287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #7 0x000071ac1de2871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
 #8 0x000071ac1de39e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
 #9 0x0000000007b67d4c (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x7b67d4c)
#10 0x0000000007b67e19 clang::Lexer::getSpelling(clang::Token const&, char const*&, clang::SourceManager const&, clang::LangOptions const&, bool*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x7b67e19)
#11 0x0000000007bfccdd clang::Preprocessor::getSpelling(clang::Token const&, llvm::SmallVectorImpl<char>&, bool*) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x7bfccdd)
#12 0x0000000007bc7710 EvaluateValue((anonymous namespace)::PPValue&, clang::Token&, DefinedTracker&, bool, clang::Preprocessor&) PPExpressions.cpp:0:0
#13 0x0000000007bcc3ab clang::Preprocessor::EvaluateDirectiveExpression(clang::IdentifierInfo*&, clang::Token&, bool&, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x7bcc3ab)
#14 0x0000000007bccf1f clang::Preprocessor::EvaluateDirectiveExpression(clang::IdentifierInfo*&, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x7bccf1f)
#15 0x0000000007bbea9f clang::Preprocessor::HandleIfDirective(clang::Token&, clang::Token const&, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x7bbea9f)
#16 0x0000000007bc3b78 clang::Preprocessor::HandleDirective(clang::Token&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x7bc3b78)
#17 0x0000000007b73e4a clang::Lexer::LexTokenInternal(clang::Token&, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x7b73e4a)
#18 0x0000000007b7600f clang::Lexer::Lex(clang::Token&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x7b7600f)
#19 0x0000000007c0766c clang::Preprocessor::Lex(clang::Token&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x7c0766c)
#20 0x0000000004b17758 clang::DoPrintPreprocessedInput(clang::Preprocessor&, llvm::raw_ostream*, clang::PreprocessorOutputOptions const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4b17758)
#21 0x0000000004aea00e clang::PrintPreprocessedAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4aea00e)
#22 0x0000000004acfad5 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4acfad5)
#23 0x0000000004a5329e clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4a5329e)
#24 0x0000000004bbe52e clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4bbe52e)
#25 0x0000000000d3a00f cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xd3a00f)
#26 0x0000000000d31a8a ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#27 0x000000000484e3d9 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const::'lambda'()>(long) Job.cpp:0:0
#28 0x0000000003d91224 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3d91224)
#29 0x000000000484e9cf clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (.part.0) Job.cpp:0:0
#30 0x00000000048112cd clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x48112cd)
#31 0x000000000481234e clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x481234e)
#32 0x000000000481a2e5 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x481a2e5)
#33 0x0000000000d36e03 clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xd36e03)
#34 0x0000000000c08aa4 main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xc08aa4)
#35 0x000071ac1de29d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#36 0x000071ac1de29e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#37 0x0000000000d31535 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xd31535)
clang++: error: clang frontend command failed with exit code 134 (use -v to see invocation)
Compiler returned: 134
```

### Expected Compiler Input
(successful preprocessing)

### Compiler Version Info
(see output above)
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzkW19v27iy_zTKC0FDomRLfsiDY8fnZG_2btEU7aNBkSOZNzIpkFTink9_QUq2JMdOm92kKHCKNLWl4fA3fzh_SJYaI0oJcB1Mb4Lp6oo2dqv09bbJQVusQUgLutZgGTX2Klf8-_U3YbeISkSNAW2FkgaDpHkFHOWNqHhAlqPXqKCiajQgYZDKDegn4KhQGlH0RCvBUWMAqQIFs3Cz2VKzgV0OPJiF6Hkr2Na9NqgSEpCpK8GELCdoqXa1qECj231dKQ3aETwG8QJtra1NEC8Csg7IulQ8V5WdKF0GZP2fgKz3_8OmX_Y0kUG4cD8kbn_Qg2o0AxSQLJiFQbw0lgsZxLfuG5k70lnY_rC6bkeKAg0Rk2yzWd_d3242wXTpKdwwIW1LDZWB0XfJRRGEix0V0s1K5ihIb4J0NZzrFOVR8Dv5pBh1-j0hZxWVZUBuAnKD8C3C32hVIfwN9lZThGvgVFrBEH5CeM8OdK9NuWC2oVU_81-NrRt7blb0BNo4i5NoEk7CUlinzhOLCLtt8glTu4Csq-rp8A-utfo_YHbiRk2LjNMU0jTOijCJec4hSVJIshkhMM8JLfJpTuek1fAXqkuwzvj7bLaZJbiRj1I9S1wJ2exxK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