]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Stop ignoring Component_Size attribute in CodePeer_Mode
authorGhjuvan Lacambre <lacambre@adacore.com>
Wed, 26 Jun 2024 14:08:20 +0000 (16:08 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Thu, 1 Aug 2024 15:14:34 +0000 (17:14 +0200)
This piece of code was introduced in 2011 in order to prevent spurious
false positives from appearing on specific code patterns making use of
Component_Size.
It seems that now this piece of code is causing small false positives
instead of preventing them, so let's remove it.

gcc/ada/

* sem_ch13.adb (Analyze_Attribute_Definition_Clause): Stop
ignoring Component_Size attribute in CodePeer_Mode.

gcc/ada/sem_ch13.adb

index 957c43d689bbe496f0d8fee7e92bdd3202bed6e6..a7936641d3430f17c5034aece46c2cf4fde7c9ed 100644 (file)
@@ -6079,24 +6079,6 @@ package body Sem_Ch13 is
          Check_Restriction_No_Specification_Of_Aspect (N);
       end if;
 
-      --  Ignore some selected attributes in CodePeer mode since they are not
-      --  relevant in this context.
-
-      if CodePeer_Mode then
-         case Id is
-
-            --  Ignore Component_Size in CodePeer mode, to avoid changing the
-            --  internal representation of types by implicitly packing them.
-
-            when Attribute_Component_Size =>
-               Rewrite (N, Make_Null_Statement (Sloc (N)));
-               return;
-
-            when others =>
-               null;
-         end case;
-      end if;
-
       --  Process Ignore_Rep_Clauses option
 
       if Ignore_Rep_Clauses then