This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/54054] New: merged compilation


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

             Bug #: 54054
           Summary: merged compilation
    Classification: Unclassified
           Product: gcc
           Version: 4.7.1
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: wbrana@gmail.com


Using command
g++-4.7.1 -O3 -march=core2 -v -o test func.cpp main.cpp
GCC compiles files separately with
cc1plus func.cpp
cc1plus main.cpp

GCC could merge these files and compile only file merged.cpp

-------func.cpp---------
#include "func.h"
#include <stdlib.h>

long int func() {
        return random();
}

-------main.cpp--------
#include "func.h"
#include <stdlib.h>

int main() {
        return func();
}

-----merged.cpp-------
#include "func.h"
#include <stdlib.h>

long int func() {
        return random();
}

int main() {
        return func();
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]