Currently when we want use template libs approach (and not instance template in
all *.o files where it is included) we have to use -fno-implicit-templates
flag. The problem is that this flag change total g++ behavior and "nuke" all
templates which is problematic when we want store only own templates in own
libs.

Please consider "port" Sun CC functionality which allow fetching templates from
external library (*.a/*.so/*.o) during compilation phase via "-instlib" flag.
This flag request on compiler to not emit code for instantiated implicitly
(i.e. by use) templates found in directed libs (-inslib=libXXX.a) and leave
resolving of those code to linker. All libs/objects files added in -instlib=xxx
flag have to be link with target. 

Such functionality will nice improve build time of project which heavily use
templates from external libs (like on Sun CC) and not force us to totally
change project like for -fno-implicit-templates flag.

*.o files (example pch.o):
 - compiler should fetch global and local symbols list.

*.a files:
 - compiler should fetch global and local symbols list.

*.so
 - compiler should fetch global symbols list.


-- 
           Summary: Please improve usage of template libs.
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bursig at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36274

Reply via email to