public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/95664] New: generic instantiation fails to detect abstract equality, builds with gcc-9 and fails to link with gcc-10
@ 2020-06-13 13:42 nicolas at debian dot org
  2020-06-13 16:01 ` [Bug ada/95664] " ludovic@ludovic-brenta.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: nicolas at debian dot org @ 2020-06-13 13:42 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95664

            Bug ID: 95664
           Summary: generic instantiation fails to detect abstract
                    equality, builds with gcc-9 and fails to link with
                    gcc-10
           Product: gcc
           Version: 10.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nicolas at debian dot org
  Target Milestone: ---

Hello.
A minimal reproducer follows.

With gcc-9.3.0 (Debian build 13), all goes well,
but gcc-10.1.0 (Debian build 3) fails to link:
# /usr/bin/ld: ./pkg.o: in function `pkg__instantiation':                       
# pkg.ads:(.text+0x9): undefined reference to `pkg__Oeq'                        

If the source is valid Ada code (I am not quite sure),
then gcc-9 is right and gcc-10 introduces a regression,
else both versions should report an error instead of their current behaviour.

cat > gen_proc.ads <<EOF                                                        
generic                                                                         
   type Data is private;                                                        
   with function Eq (L, R : Data) return Boolean is "=";                        
procedure Gen_Proc (X : Data);                                                  
EOF                                                                             
cat > gen_proc.adb <<EOF                                                        
procedure Gen_Proc (X : Data) is                                                
   B : Boolean := Eq (X, X);                                                    
begin                                                                           
   null;                                                                        
end Gen_Proc;                                                                   
EOF                                                                             
cat > pkg.ads <<EOF                                                             
with Gen_Proc;                                                                  
package Pkg is                                                                  
   type Element is null record;                                                 
   function "=" (L,R : Element) return Boolean is abstract;                     
   procedure Instantiation is new Gen_Proc (Element);                           
end Pkg;                                                                        
EOF                                                                             
cat > main.adb <<EOF                                                            
with Pkg;                                                                       
procedure Main is                                                               
begin                                                                           
   null;                                                                        
end Main;                                                                       
EOF                                                                             
gnatmake main.adb

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-06-29 11:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-13 13:42 [Bug ada/95664] New: generic instantiation fails to detect abstract equality, builds with gcc-9 and fails to link with gcc-10 nicolas at debian dot org
2020-06-13 16:01 ` [Bug ada/95664] " ludovic@ludovic-brenta.org
2020-06-14  5:21 ` rosen at adalog dot fr
2020-06-29 11:10 ` [Bug ada/95664] link failure with abstract equality operator ebotcazou at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).