Landing: 53518f21404e

Project / Subsystem

gcc / ada

Date

2026-01-04

Author

Javier Miranda

Commit

53518f21404e2f54bf17edc63aef779468775757

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
ada
patch_id
commit_hash
53518f21404e2f54bf17edc63aef779468775757
source_type
github
headline
Handle calls to C++ constructors within return statements.
tldr
The Ada compiler can now handle C++ constructor calls in the return statement of functions.
author
Javier Miranda
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • ada
  • C++
  • interoperability
discussion_id_link
bugzilla_pr
date
2026-01-04T00:00:00.000Z

The Ada compiler previously lacked support for C++ constructor calls placed directly within the return statement of a function. This commit adds the necessary logic to Analyze_Object_Declaration and Expand_N_Object_Declaration to handle this case correctly. The compiler will now report an error if the return statement of a function with a foreign convention has a call to a C++ constructor.