C++: Adjust implicit '__cxa_bad_typeid' prototype to reality
Thomas Schwinge
tschwinge@baylibre.com
Tue Mar 25 13:17:51 GMT 2025
Hi!
On 2025-03-24T13:38:56-0400, Jason Merrill <jason@redhat.com> wrote:
> On 3/24/25 7:02 AM, Thomas Schwinge wrote:
>> On 2025-03-21T15:46:01+0100, I wrote:
>>> On 2025-03-19T14:25:49+0000, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
>>>> On Wed, 19 Mar 2025 at 14:21, Marek Polacek <polacek@redhat.com> wrote:
>>>>> On Wed, Mar 19, 2025 at 12:38:31PM +0100, Thomas Schwinge wrote:
>>>>>> --- a/gcc/cp/rtti.cc
>>>>>> +++ b/gcc/cp/rtti.cc
>>>>>> @@ -198,7 +198,7 @@ throw_bad_cast (void)
>>>>>> fn = get_global_binding (name);
>>>>>> if (!fn)
>>>>>> fn = push_throw_library_fn
>>>>>> - (name, build_function_type_list (ptr_type_node, NULL_TREE));
>>>>>> + (name, build_function_type_list (void_type_node, NULL_TREE));
>>>>>> }
>>>>>>
>>>>>> return build_cxx_call (fn, 0, NULL, tf_warning_or_error);
>>>>>
>>>>> LGTM, matches what I see in abi-eh.html from the itanium-cxx-abi.
>>
>>> [...] I've now pushed to trunk branch:
>>> commit 618c42d23726be6e2086d452d6718abe5e0daca8
>>> "C++: Adjust implicit '__cxa_bad_cast' prototype to reality", [...]
>>
>> So, a similar problem exists for '__cxa_bad_typeid'. See the attached
>> "[WIP] C++: Adjust implicit '__cxa_bad_typeid' prototype to reality" for
>> what seemed to be the corresponding patch for that one. However, that
>> isn't sufficient; we run into internal errors like:
>>
>> [...]/g++.dg/rtti/typeid1.C: In function 'int main()':
>> [...]/g++.dg/rtti/typeid1.C:9:12: error: lvalue required as unary '&' operand
>>
>> I got lost in the C++ front end code trying to understand how to resolve
>> this mismatch. Anyone able to advise, please?
>
> This addition seems to resolve it: [...]
Yes, thanks! OK to push the attached
"C++: Adjust implicit '__cxa_bad_typeid' prototype to reality"?
Grüße
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-C-Adjust-implicit-__cxa_bad_typeid-prototype-to-real.patch
Type: text/x-diff
Size: 4891 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/libstdc++/attachments/20250325/76ed71dc/attachment.bin>
More information about the Libstdc++
mailing list