Explorar o código

COMP: HP compiler does not like initializing a const std::string & with a const char* (which requires the reference to be bound to a temporary with the scope of the reference).

Brad King %!s(int64=20) %!d(string=hai) anos
pai
achega
c1ca511331
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      Source/cmMakefile.cxx

+ 2 - 1
Source/cmMakefile.cxx

@@ -1116,6 +1116,7 @@ cmTarget* cmMakefile::AddExecutable(const char *exeName,
 cmSourceFile *cmMakefile::GetSourceFileWithOutput(const char *cname)
 {
   std::string name = cname;
+  std::string out;
 
   // look through all the source files that have custom commands
   // and see if the custom command has the passed source file as an output
@@ -1127,7 +1128,7 @@ cmSourceFile *cmMakefile::GetSourceFileWithOutput(const char *cname)
     if ((*i)->GetCustomCommand())
       {
       // is the output of the custom command match the source files name
-      const std::string &out = (*i)->GetCustomCommand()->GetOutput();
+      out = (*i)->GetCustomCommand()->GetOutput();
       if (out.rfind(name) != out.npos &&
           out.rfind(name) == out.size() - name.size())
         {