[clang] [Clang] Implement P3034R1 Module Declarations Shouldn’t be Macros (PR #90574)

via cfe-commits cfe-commits at lists.llvm.org
Sat May 4 07:52:43 PDT 2024


cor3ntin wrote:

> > I think the approach looks good.
> > Do we have existing tests for the use of `module` as an identifier outside of a module declaration?
> 
> IIUC, do you mean something looks like the following? I didn't find it in the test case:
> 
> ```
> void foo() {
>   int module = 0;
> }
> ```

Yes, it might be useful to have that somewhere

I think in `ParseModuleDecl`, you want to reset the lexer kind before parsing attributes. 
(and add tests for that)

Here is a test:

```cpp
#define ATTRS [[]]
#define SEMICOLON
module unexpanded : unexpanded : ATTRS SEMICOLON
``` 

Sorry i did not notice that earlier.
The goal of the paper is that the name of the module is not a macro. everything else can be, including attributes attached to the module


https://github.com/llvm/llvm-project/pull/90574


More information about the cfe-commits mailing list