[LLVMbugs] [Bug 7435] New: False error: array 'new' cannot have initialization arguments

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Jun 21 02:43:55 PDT 2010


http://llvm.org/bugs/show_bug.cgi?id=7435

           Summary: False error: array 'new' cannot have initialization
                    arguments
           Product: clang
           Version: trunk
          Platform: Macintosh
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: Fons.Rademakers at cern.ch
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


Created an attachment (id=5073)
 --> (http://llvm.org/bugs/attachment.cgi?id=5073)
Source file exhibiting the problem

The attached aap.cxx compiles fine with g++ (and for that matter any other know
compiler), but not with clang++. Do:

clang++ -c aap.cxx
In file included from roofit/roofitcore/src/RooDataHist.cxx:1:
In file included from roofit/roofitcore/src/RooDataHist.cxx:35:
In file included from include/RooDataHist.h:23:
include/RooCacheManager.h:131:16: error: array 'new' cannot have initialization
      arguments
  _nsetCache = new RooNormSetCache[_maxSize] ;
               ^
In file included from roofit/roofitcore/src/RooDataHist.cxx:1:
roofit/roofitcore/src/RooDataHist.cxx:58:30: note: in instantiation of member
      function 'RooCacheManager<std::vector<double, std::allocator<double> >
      >::RooCacheManager' requested here
RooDataHist::RooDataHist() : _pbinvCacheMgr(0,10)
                             ^
In file included from roofit/roofitcore/src/RooDataHist.cxx:1:
In file included from roofit/roofitcore/src/RooDataHist.cxx:35:
In file included from include/RooDataHist.h:23:
include/RooCacheManager.h:151:16: error: array 'new' cannot have initialization
      arguments
  _nsetCache = new RooNormSetCache[_maxSize] ;
               ^
In file included from roofit/roofitcore/src/RooDataHist.cxx:1:
roofit/roofitcore/src/RooDataHist.cxx:813:125: note: in instantiation of member
      function 'RooCacheManager<std::vector<double, std::allocator<double> >
      >::RooCacheManager' requested here
  ..._curVolume(1), _pbinv(0), _pbinvCacheMgr(other._pbinvCacheMgr,0)
                               ^
2 errors generated.

Note that there are 3 methods with the line:

_nsetCache = new RooNormSetCache[_maxSize] ;

but in only 2 cases clang+= reports the error. For me its not clear what the
difference is.

Code compiles fine with g++.

Cheers, Fons.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list