[llvm-bugs] [Bug 49771] New: clang++ chockes on modules when specifying c++20

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Mar 30 08:38:29 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=49771

            Bug ID: 49771
           Summary: clang++ chockes on modules when specifying c++20
           Product: clang
           Version: 11.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++2a
          Assignee: unassignedclangbugs at nondot.org
          Reporter: mattias.l.sk at gmail.com
                CC: blitzrakete at gmail.com, erik.pilkington at gmail.com,
                    llvm-bugs at lists.llvm.org, richard-llvm at metafoo.co.uk

I have a program for prescanning source files. That program invokes 

```
    clang++ -std=20 ..include flags.. source.cpp -E > output
```

Say that i have a file called source.cpp:

```
   import x;
``` 

Then when trying to expand it with -E i get an error that "module x is not
found". That seems to be a bug. Surely the lookup of modules does not need to
be performed to be able to expand the macros of a file?

This problem is only present if you specify the c++ version to be 20, and not
for example 17. My guess is that this makes modules enabled.

If this is not a bug, how do you expand macros in a file without getting a
error for imports?


tested with clang++-11 and clang++-12

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210330/bda6d22d/attachment.html>


More information about the llvm-bugs mailing list