summaryrefslogtreecommitdiff
path: root/libjava/classpath/test/java.io/LineNumberInputStreamTest.java
diff options
context:
space:
mode:
authorBob Duff <duff@adacore.com>2025-11-10 13:21:02 -0500
committerMarc Poulhiès <dkm@gcc.gnu.org>2025-11-21 09:29:36 +0100
commitf9ee1322a8297e2391e24b52f9f19028142e0b92 (patch)
tree52d861c2ade9720f9f4ec195a336d6fc2c774975 /libjava/classpath/test/java.io/LineNumberInputStreamTest.java
parentf4312f92c0b723c607419844818b075b8c020b9c (diff)
ada: Avoid incorrect errors for duplicate formal iterator names
This patch fixes the following bug: If a type has an Iterable aspect (as in the formal containers), and two or more cursor loops of the form "for C in ..." occur in the same scope, and the cursor type has discriminants without defaults, the compiler complains incorrectly about duplicate names "Tc". This is because the generated declaration of the C object was being analyzed in the wrong scope. In the discriminated case, an internal subtype name TcS is generated for each C. Errout "helpfully" removes "S" in the error message, resulting in a complaint about "Tc". The fix is to push the correct scope (that of the generated surrounding block statement) when analyzing the declaration of C. gcc/ada/ChangeLog: * exp_ch5.adb (Expand_Formal_Container_Loop): Analyze Init_Decl in the correct scope. Remove patch-up code that was needed because we were using the wrong scope. * exp_ch7.adb (Process_Object_Declaration): Remove code to unique-ify the name of Master_Node_Id; no longer needed because of change to exp_ch5.adb. * sem_warn.adb (Check_References): Suppress warnings during preanalysis, because we don't have complete information yet; otherwise, the new Preanalyze call in exp_ch5.adb generates bogus warnings.
Diffstat (limited to 'libjava/classpath/test/java.io/LineNumberInputStreamTest.java')
0 files changed, 0 insertions, 0 deletions