Opened 5 years ago

Closed 4 months ago

#199 closed enhancement (fixed)

Only Forward Declare Concrete Instantiations When Needed

Reported by: ajbeach Owned by:
Priority: trivial Component: cfa-cc
Version: 1.0 Keywords:
Cc:

Description

Currently the GenericInstantiator? produces two declarations for every concrete instantiation it creates. A forward declaration and then a complete declaration.

This is done because in between the two declarations all the other concrete declarations the complete declaration refers to are emitted. If these refer back to the type the forward declaration means the name is in scope which allows this to compile without error.

Still the cases where this extra forward declaration is actually used are quiet rare. To avoid producing them the compiler would have to track which ones have been seen separately from the ones that are actually in scope.

Change History (1)

comment:1 Changed 4 months ago by ajbeach

Resolution: fixed
Status: newclosed

Fixed in: 30bf6bf3677858106dafefcbfae7eff10d078623

Less important but I stumbled across it and thought of a good simple solution.

Note: See TracTickets for help on using tickets.