mirror of
https://forge.sourceware.org/marek/gcc.git
synced 2026-02-22 12:00:11 -05:00
The compiler blows up processing the declaration of a tagged type variable that has a C++ constructor without external or link name. After this patch the frontend reports an error. 2019-07-22 Javier Miranda <miranda@adacore.com> gcc/ada/ * freeze.adb (Freeze_Subprogram): Check that C++ constructors must have external or link name. gcc/testsuite/ * gnat.dg/cpp_constructor2.adb: New testcase. From-SVN: r273670
20 lines
433 B
Ada
20 lines
433 B
Ada
-- { dg-do compile }
|
|
|
|
procedure CPP_Constructor2 is
|
|
|
|
package P is
|
|
type X is tagged limited record
|
|
A, B, C, D : Integer;
|
|
end record;
|
|
pragma Import (Cpp, X);
|
|
|
|
procedure F1 (V : X);
|
|
pragma Import (Cpp, F1);
|
|
|
|
function F2 return X; -- { dg-error "C\\+\\+ constructor must have external name or link name" }
|
|
pragma Cpp_Constructor (F2);
|
|
end P;
|
|
begin
|
|
null;
|
|
end CPP_Constructor2;
|