[Ada] Compiler loop on expression function and predicate in generic unit
This patch fixes an infinite loop in the compiler when analyzing an
expression function whose expression mentions a subtype with a static
predicate, and the context is a generic unit.
2018-05-25 Ed Schonberg <schonberg@adacore.com>
gcc/ada/
* sem_ch13.adb (Build_Predicate_Functions): The predicate function
declaration is inserted into the tree and analyzed at that point, so
should not be reinserted when the body is constructed. Inside a
generic, ensure that the body is not inserted twice in the tree.
gcc/testsuite/
* gnat.dg/static_pred1.adb, gnat.dg/static_pred1.ads: New testcase.
From-SVN: r260716