<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/135755>135755</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang-scan-deps] Unable to handle the #if macro correctly
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
MacroModel
</td>
</tr>
</table>
<pre>
impl.cppm
```cpp
module;
#define MODULE
#include "impl.h"
```
impl.h
```cpp
#pragma once
#ifdef MODULE
export module test;
#endif // MODULE
#ifdef MODULE
import test_old;
#endif // MODULE
#if 1
#ifdef OTHER
export
#endif // OTHER
namespace test {
}
#endif // 1
```
```bash
PS D:\test\20250410> clang-scan-deps --format=p1689 -- D:\tool-chain\x86_64-windows-gnu\llvm\bin\clang -x c++ -c impl.cppm -o impl.cppm.obj -Qunused-arguments -m64 --target=x86_64-windows-msvc -Wall -Wextra -Werror -ffp-model=fast -O3 -std=c++26 -fms-runtime-lib=dll -fexceptions -fcxx-exceptions -finput-charset=UTF-8 -fexec-charset=UTF-8 -flto=thin -Wno-braced-scalar-init -fno-ident -fno-rtti -fno-unwind-tables -march=native
Error while scanning dependencies for impl.cppm:
In file included from impl.cppm:3:
./impl.h:11:2: error: unterminated conditional directive
{
"revision": 0,
"rules": [],
"version": 1
}
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyMVE2PozgQ_TXOpeQIbAjJgUM6dLQrbav3Y1p9HBm7CB4ZG9kmnfn3KxOUZGb6MBIShavq8fzqQ4SgTxaxJuUTKZuVmGLvfP0ipHcvTqFZtU59r_UwmrUcx4Fke7LJro8cR5LtB6cmg4Q_JRfjCjttEV5em7e_nq9H2kozKQTC2IzTE8YecZKd7RfXL_iE8dGL0yDAWYnX2ATaKezuv8HL6HyEKxmIGOKNEVqlOyDsSNjxgddnKHqYUVL6V2fUb0JA_gj2-uWP53_hRukTgFsEAIAVA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