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: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]


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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to