Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
This implementation preserves support for identifiers L__FUNCSIG__ and L__FUNCTION__ (which have never been supported by MSVC), and adds other identifiers for all supported encodings: L, u8, u, U.
If breaking backwards compatibility in clang (with Microsoft Extensions) is allowed, then I'd prefer other (more correct) solution: support for __LPREFIX-family macros ( see https://godbolt.org/z/eacYqh1ab ), and remove token/identifiers like L__FUNCTION__; relevant issue https://github.com/llvm/llvm-project/issues/27402
I'll try to implement this alternative approach.
This does not appear to be valid under MSVC and I don't think we should support features that MS does not (Nor can i find any documentation that it ought to work)
https://godbolt.org/z/7Te3YYeb9
Supporting the same concatenation behavior MSVC does have seem like a cleaner approach. We would not have an many new tokens.
Before you do anything though. I'd like the feedback of more folks.
I can't find any documentation for LPREFIX, but it seems in the general case, it can be emulated that way https://godbolt.org/z/dr7MjMs99
In terms of breaking change, it's only an issue if L/u/etc are existing macro at the point of use.
Agreed -- we typically do not want to make extensions to Microsoft's extensions.
Supporting the same concatenation behavior MSVC does have seem like a cleaner approach. We would not have an many new tokens.
Before you do anything though. I'd like the feedback of more folks.I can't find any documentation for LPREFIX, but it seems in the general case, it can be emulated that way https://godbolt.org/z/dr7MjMs99
In terms of breaking change, it's only an issue if L/u/etc are existing macro at the point of use.
It's a bit hard to reason about __LPREFIX given there's no documentation for it and it's not a macro that expands to anything we can poke at. However, https://github.com/llvm/llvm-project/issues/27402 shows there is interest in having Clang support it, so I weakly lean towards that option, though it may be more effort to reverse engineer how it works for various edge cases.
I found a way to implement __LPREFIX-macros-family in Clang. I need some more time to finish and polish it. Going to post it a couple of weeks later.