[clang] [clang][msvc] Fix crash when mangling concept template arguments (PR #192951)
Matheus Izvekov via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 21 08:48:32 PDT 2026
mizvekov wrote:
The problem here is implementing the MS mangling for concept template
parameters. They haven’t implemented the feature yet, but we can probably
take a good guess at what it will be.
On Tue, 21 Apr 2026 at 08:20 Elio ***@***.***> wrote:
> *xiongzile* left a comment (llvm/llvm-project#192951)
> <https://github.com/llvm/llvm-project/pull/192951?email_source=notifications&email_token=AAEFB36BVJM3QIZYF4ZVWST4W5KQLA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIMRYHAYTCNZUG44KM4TFMFZW63VMORSWC3K7NVSW45DJN5XKKZLWMVXHJNLQOJPWG33NNVSW45C7N5YGK3S7MNWGSY3L#issuecomment-4288117478>
>
> @zyn0217 <https://github.com/zyn0217>
> Agreed with your point. Diagnosing here makes no sence. I've convert my PR
> to a draft.
> Here is my current understanding of the behavior in the two compilers:
> 1. MSVC rejects this construct outright — it does not allow a concept to
> be used as a template template argument, and emits a diagnostic during
> compilation.(see the above godbolt link)
> 2. In Clang with the MSVC target, the frontend actually accepts this
> syntax. However, if the concept is later used as a template template
> argument and reaches the Microsoft mangling path, it leads to a null
> dyn_cast and crashes.
>
> At this point, I’m not entirely sure what the correct direction is for
> Clang to align with MSVC’s behavior. If the intended behavior is to reject
> this construct under the MSVC target, that would suggest adding an earlier
> diagnostic rather than fixing the mangling path. Otherwise, if we keep the
> current frontend behavior, the mangler would need to handle this case
> properly.
>
> Given this uncertainty, I’m considering closing this PR for now.
>
> —
> Reply to this email directly, view it on GitHub
> <https://github.com/llvm/llvm-project/pull/192951?email_source=notifications&email_token=AAEFB36BVJM3QIZYF4ZVWST4W5KQLA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIMRYHAYTCNZUG44KM4TFMFZW63VMORSWC3K7NVSW45DJN5XKKZLWMVXHJNLQOJPWG33NNVSW45C7N5YGK3S7MNWGSY3L#issuecomment-4288117478>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAEFB32TLHCXIWJERQL2WST4W5KQLAVCNFSM6AAAAACX7PPXZCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DEOBYGEYTONBXHA>
> .
> You are receiving this because you are on a team that was mentioned.Message
> ID: ***@***.***>
>
https://github.com/llvm/llvm-project/pull/192951
More information about the cfe-commits
mailing list