Today I tried to work on a project that I developed some time ago. I was surprised when I encountered a compilation error, since I successfully compiled my project using g ++.
This short fragment reproduces the line in which the error was detected:
int main() { __attribute__((aligned(16)) char arr[5]; }
What causes this error:
test.cpp:2:32: error: expected ')' __attribute__((aligned(16)) char arr[5]; ^ )
As you can see, there is a mournful bracket. There are three '(' and two ')'. This clearly looks like a compilation error actually occurs.
Is this a valid use of this keyword? I can't seem to find anything in the documentation , which indicates that it is.
I am using g ++ 4.5.2 and clang 2.8.
Note that this error is detected when using gcc instead of g ++.
source share