<div dir="ltr"><div>Hi,</div><div><br></div><div>I'm currently working on a clang cast tool and ran into a small oddity. This might be a stupid mistake but I'd love some pointers(no pun intended) or insight into it:</div><div><br></div><div>const int arr[2] {1,2};</div><div><br></div><div>should be "an array of fixed size 2 of constant integers". The QualType associated with arr is an array type, and we can observe that with Expr->isArrayType(). I checked the qualifiers and found that the qualifier for const is actually on this level, and not for the individual elements of ints. I found the elements inside of the array with the following:</div><div><br></div><div>const ArrayType* ArrType = dyn_cast<ArrayType>(MyQualType);</div><div>ArrType->getElementType();</div><div><br></div><div>which I was hoping could give me the const qualifier for the integers. If it helps at all, I'm using the getLocalFastQualifiers() function to return an unsigned int, and I'm seeing if 0x1 is masked for constness.</div><div><br></div><div>Since arrays can't really have qualifiers(the only example I see is on the<a href="https://en.cppreference.com/w/c/language/array"> standards</a> for function parameters for C99 and not C++), was there a reason for why clang decided to put the qualifiers on the array qualtype rather than the elements' qualtype?</div><div><br></div><div>If I made any unreasonable assumptions to reach this conclusion, please let me know :)</div><div><br></div><div>Best,</div><div>Ray<br></div></div>