Problem description. Some combinations of using a Holder and Vector cause incorrect behavior. ENVIRONMENT: gnat 4.9.2 NOTE: The code is a pared down version of the original. I have removed and simplified it to the minimal version which still produces the incorrect behaviors. ORIGINAL CODE: The original code is for a parser which reads tokens and returns an object which holds a fixed size array with the tokens. Each token has a discriminant, so they are held inside a Holder. EXAMPLES: Example 1: The controlled type Dummy doesn't have its Finalize procedure called when the object exits the scope of the Get_Cached_Data function. If one examines the disassembled code of the executable, the finalizer for Get_Cached_Data doesn't include a call to dummy's Finalize. It seems that gnatbind omits the call to Dummy's Finalizer when it is building the body of the Get_Cached_Data function's finalizer. Example 2: The Finalize procedure gets called twice. dtor_broken_example_1: INCORRECT BEHAVIOR: dummy Finalize doesn't get called. dtor_broken_example_2: INCORRECT BEHAVIOR: dummy Finalize is called twice. dtor_correct_example_1: dummy Finalize is called as the A_Statement object leaves the scope. dtor_correct_example_2: dummy Finalize is called as the A_Statement object leaves the scope. --------------------------------------------------- The incorrectly working example 1 has one line changed: -- if True then if Vec.Is_Empty then The example #2 has the package declaration package Record_Vectors is new Ada.Containers.Vectors(Positive, Integer); moved up.