rakshasa/libtorrent — Issue #14: compile error with clang - rak::cacheline_allocator
Author: trevor
Created: 2012-02-27 00:55:02+00:00
State: open

```
% clang++ -v
Apple clang version 3.1 (tags/Apple/clang-318.0.45) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin11.3.0
Thread model: posix
```

```
libtool: compile: /usr/bin/clang++ -DHAVE_CONFIG_H -I. -I../.. -I. -I./.. -I../.. -Os -w -pipe -march=native -Qunused-arguments -DNDEBUG -fvisibility=hidden -I/usr/local/Cellar/libsigc++/2.2.10/include/sigc++-2.0 -I/usr/local/Cellar/libsigc++/2.2.10/lib/sigc++-2.0/include -c rate.cc -fno-common -DPIC -o .libs/rate.o
poll_select.cc:126:28: error: cannot allocate function type 'rak::cacheline_allocator<> ()' with new
block_type* block = new (rak::cacheline_allocator<>()) block_type;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[4]: *** [poll_select.lo] Error 1
```

no error with llvm
```
% llvm-gcc -v
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.9~22/src/configure --disable-checking --enable-werror --prefix=/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.9~22/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.9.00)
```