Skip to content

Conversation

@lanza
Copy link
Member

@lanza lanza commented Nov 22, 2025

Stack from ghstack (oldest at bottom):

Fixes an assertion failure when creating RTTI descriptors for types
with top-level qualifiers (const, volatile, etc.). The Itanium C++ ABI
requires that RTTI descriptors be created for unqualified types only,
but ClangIR was passing qualified types to the mangling function.

The fix strips qualifiers in BuildTypeInfo before mangling, matching
the behavior of traditional CodeGen. Also strips qualifiers when
getting RTTI descriptors for dynamic_cast operands, consistent with
CodeGen's implementation.

This fixes std::regex usage and other cases where qualified types
are used with typeid or dynamic_cast.

[ghstack-poisoned]
lanza added a commit that referenced this pull request Nov 22, 2025
Fixes an assertion failure when creating RTTI descriptors for types
with top-level qualifiers (const, volatile, etc.). The Itanium C++ ABI
requires that RTTI descriptors be created for unqualified types only,
but ClangIR was passing qualified types to the mangling function.

The fix strips qualifiers in BuildTypeInfo before mangling, matching
the behavior of traditional CodeGen. Also strips qualifiers when
getting RTTI descriptors for dynamic_cast operands, consistent with
CodeGen's implementation.

This fixes std::regex usage and other cases where qualified types
are used with typeid or dynamic_cast.


ghstack-source-id: 3c9ffe9
Pull-Request: #2002
[ghstack-poisoned]
lanza added a commit that referenced this pull request Nov 24, 2025
Fixes an assertion failure when creating RTTI descriptors for types
with top-level qualifiers (const, volatile, etc.). The Itanium C++ ABI
requires that RTTI descriptors be created for unqualified types only,
but ClangIR was passing qualified types to the mangling function.

The fix strips qualifiers in BuildTypeInfo before mangling, matching
the behavior of traditional CodeGen. Also strips qualifiers when
getting RTTI descriptors for dynamic_cast operands, consistent with
CodeGen's implementation.

This fixes std::regex usage and other cases where qualified types
are used with typeid or dynamic_cast.


ghstack-source-id: e18ff76
Pull-Request: #2002
[ghstack-poisoned]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants