comp.lang.ada
 help / color / mirror / Atom feed
From: reinert <reinkor@gmail.com>
Subject: Did I find a bug here?
Date: Thu, 1 Apr 2021 23:30:54 -0700 (PDT)	[thread overview]
Message-ID: <6901cec3-b7b1-48c8-98fe-0360572175c2n@googlegroups.com> (raw)

Assume this simple program:

procedure test0 is
  type ABC_Type is (A,B,C);
  subtype AB_Type is ABC_Type with Static_Predicate => AB_Type in A | B;
  X : ABC_type    := A;
begin
-- alternative 1:  
case AB_Type(X) is
    when A => null;
    when B => null;
    when others => null; -- ??? should the compiler complain here?
  end case;
--alternative 2:
  case AB_Type(X) is
    when A => null;
    when B => null;
  end case;
end test0;

Should the compiler complain about "when others => null" here?
My compiler does not (running debian 10, updated, gnat-8).
I find it strange that both alternatives goes through.

reinert

             reply	other threads:[~2021-04-02  6:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-02  6:30 reinert [this message]
2021-04-02  7:30 ` Did I find a bug here? J-P. Rosen
2021-04-02  8:33   ` Niklas Holsti
2021-04-03  5:46     ` reinert
2021-04-03  6:41       ` J-P. Rosen
2021-04-03  8:18         ` Niklas Holsti
2021-04-03 12:37           ` J-P. Rosen
  -- strict thread matches above, loose matches on Subject: below --
2021-04-02  6:15 reinert
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox