Opened 4 years ago
#199 new enhancement
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.