Bug#714215: llvm-3.2-dev: Compilation error: "'alignas' attribute cannot be applied to types"

Julien Bernard axolotl.me at gmail.com
Wed Jun 26 21:29:13 UTC 2013


Package: llvm-3.2-dev
Version: 1:3.2repack-10
Severity: normal

Dear Maintainer,

An error happens when trying the next commands:
$ cat bug.cc 
#include <llvm/IRBuilder.h>

int main() {
  return 0;
}
$ clang++ `llvm-config --libs Core --cflags --ldflags` -std=c++11 bug.cc 
In file included from bug.cc:1:
In file included from /usr/lib/llvm-3.2/include/llvm/IRBuilder.h:18:
In file included from /usr/lib/llvm-3.2/include/llvm/Instructions.h:21:
In file included from /usr/lib/llvm-3.2/include/llvm/Attributes.h:19:
In file included from /usr/lib/llvm-3.2/include/llvm/ADT/ArrayRef.h:13:
In file included from /usr/lib/llvm-3.2/include/llvm/ADT/SmallVector.h:17:
/usr/lib/llvm-3.2/include/llvm/Support/AlignOf.h:90:1: error: 'alignas' attribute cannot be applied to types
LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(1);
^
/usr/lib/llvm-3.2/include/llvm/Support/AlignOf.h:79:10: note: expanded from macro 'LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT'
    char alignas(x) aligned; \
         ^
/usr/lib/llvm-3.2/include/llvm/Support/AlignOf.h:91:1: error: 'alignas' attribute cannot be applied to types
LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(2);
^
/usr/lib/llvm-3.2/include/llvm/Support/AlignOf.h:79:10: note: expanded from macro 'LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT'
    char alignas(x) aligned; \
         ^
/usr/lib/llvm-3.2/include/llvm/Support/AlignOf.h:92:1: error: 'alignas' attribute cannot be applied to types
LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(4);
^
/usr/lib/llvm-3.2/include/llvm/Support/AlignOf.h:79:10: note: expanded from macro 'LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT'
    char alignas(x) aligned; \
         ^
/usr/lib/llvm-3.2/include/llvm/Support/AlignOf.h:93:1: error: 'alignas' attribute cannot be applied to types
LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(8);
^
/usr/lib/llvm-3.2/include/llvm/Support/AlignOf.h:79:10: note: expanded from macro 'LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT'
    char alignas(x) aligned; \
         ^
/usr/lib/llvm-3.2/include/llvm/Support/AlignOf.h:94:1: error: 'alignas' attribute cannot be applied to types
LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(16);
^
/usr/lib/llvm-3.2/include/llvm/Support/AlignOf.h:79:10: note: expanded from macro 'LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT'
    char alignas(x) aligned; \
         ^
/usr/lib/llvm-3.2/include/llvm/Support/AlignOf.h:95:1: error: 'alignas' attribute cannot be applied to types
LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(32);
^
/usr/lib/llvm-3.2/include/llvm/Support/AlignOf.h:79:10: note: expanded from macro 'LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT'
    char alignas(x) aligned; \
         ^
/usr/lib/llvm-3.2/include/llvm/Support/AlignOf.h:96:1: error: 'alignas' attribute cannot be applied to types
LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(64);
^
/usr/lib/llvm-3.2/include/llvm/Support/AlignOf.h:79:10: note: expanded from macro 'LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT'
    char alignas(x) aligned; \
         ^
/usr/lib/llvm-3.2/include/llvm/Support/AlignOf.h:97:1: error: 'alignas' attribute cannot be applied to types
LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(128);
^
/usr/lib/llvm-3.2/include/llvm/Support/AlignOf.h:79:10: note: expanded from macro 'LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT'
    char alignas(x) aligned; \
         ^
/usr/lib/llvm-3.2/include/llvm/Support/AlignOf.h:98:1: error: 'alignas' attribute cannot be applied to types
LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(512);
^
/usr/lib/llvm-3.2/include/llvm/Support/AlignOf.h:79:10: note: expanded from macro 'LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT'
    char alignas(x) aligned; \
         ^
/usr/lib/llvm-3.2/include/llvm/Support/AlignOf.h:99:1: error: 'alignas' attribute cannot be applied to types
LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(1024);
^
/usr/lib/llvm-3.2/include/llvm/Support/AlignOf.h:79:10: note: expanded from macro 'LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT'
    char alignas(x) aligned; \
         ^
/usr/lib/llvm-3.2/include/llvm/Support/AlignOf.h:100:1: error: 'alignas' attribute cannot be applied to types
LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(2048);
^
/usr/lib/llvm-3.2/include/llvm/Support/AlignOf.h:79:10: note: expanded from macro 'LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT'
    char alignas(x) aligned; \
         ^
/usr/lib/llvm-3.2/include/llvm/Support/AlignOf.h:101:1: error: 'alignas' attribute cannot be applied to types
LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(4096);
^
/usr/lib/llvm-3.2/include/llvm/Support/AlignOf.h:79:10: note: expanded from macro 'LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT'
    char alignas(x) aligned; \
         ^
/usr/lib/llvm-3.2/include/llvm/Support/AlignOf.h:102:1: error: 'alignas' attribute cannot be applied to types
LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(8192);
^
/usr/lib/llvm-3.2/include/llvm/Support/AlignOf.h:79:10: note: expanded from macro 'LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT'
    char alignas(x) aligned; \
         ^
13 errors generated.


The error does not happen when -std=c++11 is not present.

For further information:
$ llvm-config --libs Core --cflags --ldflags
-I/usr/lib/llvm-3.2/include  -DNDEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -g -O2 -fomit-frame-pointer -fPIC
-L/usr/lib/llvm-3.2/lib  -lpthread -lffi -ldl -lm 
-lLLVMCore -lLLVMSupport
$ clang++ --version
Debian clang version 3.3-2 (branches/release_33) (based on LLVM 3.3)
Target: x86_64-pc-linux-gnu
Thread model: posix

The error has been corrected in llvm-3.3-dev (the 'alignas(...)' expression should be placed before the 'char' type, not after).


-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.9-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages llvm-3.2-dev depends on:
ii  libc6          2.17-5
ii  libcloog-isl4  0.18.0-2
ii  libffi-dev     3.0.13-4
ii  libffi6        3.0.13-4
ii  libgcc1        1:4.8.1-4
ii  libgmp10       2:5.1.2+dfsg-1
ii  libisl10       0.11.2-1
ii  libllvm3.2     1:3.2repack-10
ii  libstdc++6     4.8.1-4
ii  llvm-3.2       1:3.2repack-10

llvm-3.2-dev recommends no packages.

llvm-3.2-dev suggests no packages.

-- no debconf information



More information about the Pkg-llvm-team mailing list