Issue 135755
Summary [clang-scan-deps] Unable to handle the #if macro correctly
Labels new issue
Assignees
Reporter MacroModel
    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
}

```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to