[Ada] Post warning on object size clause for subtype
authorEric Botcazou <ebotcazou@adacore.com>
Thu, 31 May 2018 10:45:57 +0000 (10:45 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Thu, 31 May 2018 10:45:57 +0000 (10:45 +0000)
commit42e4b796dccc43e0a30cd26186037f3fda7639fd
tree8b5c16ea50b86b6a95926011662787278726e603
parent59f7c7167a75bdb3992f2c7fb3b358124aea8404
[Ada] Post warning on object size clause for subtype

This ensures that a warning for an object size clause present on a subtype
is posted on the clause and not on a size clause present on the type.

2018-05-31  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* einfo.ads (Object_Size_Clause): Declare.
* einfo.adb (Object_Size_Clause): New function.
* gcc-interface/utils.c (maybe_pad_type): Test Has_Size_Clause before
retrieving Size_Clause and post the warning on the object size clause
if Has_Object_Size_Clause is true.

gcc/testsuite/

* gnat.dg/size_clause1.adb: New testcase.

From-SVN: r260998
gcc/ada/ChangeLog
gcc/ada/einfo.adb
gcc/ada/einfo.ads
gcc/ada/gcc-interface/utils.c
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/size_clause1.adb [new file with mode: 0644]