================
----------------
yronglin wrote:
> It might be simpler and more correct to remove the `ParsingFilename` flag
> entirely, and instead call into a different lexing routine here that does the
> horizontal whitespace skipping then filename handling for a token starting
> with `<` or `"`, and otherwise just invokes the normal lexer. The approach in
> this PR only handles the case where a macro results in the filename not
> immediately following the introducing token, but not other cases such as:
>
> ```c++
> #include _Pragma("") "foo\"bar\".h"
> ```
>
> (I don't know if we _should_ allow empty `_Pragma`s -- or in general, pragmas
> that don't inject tokens -- there, but we do allow them _after_ the filename,
> and we're supposed to be applying the same rules in both places.)
Does C++20 `import` also follows this rule?
[[cpp.pre]/2.2](https://eel.is/c++draft/cpp.pre#2.2):
an import preprocessing token immediately followed on the same logical source
line by a [header-name](https://eel.is/c++draft/lex.header#nt:header-name), <,
[identifier](https://eel.is/c++draft/lex.name#nt:identifier), or :
preprocessing token, or...
Does the following is a valid import directive?
```cpp
import EMPTY "foo.h";
```
https://github.com/llvm/llvm-project/pull/225451
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits