can we know if an array definition has an explicit size ??


int arr[3] = { 1, 2, 3 }

still get a ConstantArrayType.

Actually, if there’s no explict size, RecursiveASTVisitor::VisitIncompleteArrayType will get called, but in this function context, i can not get the source location (because the argument to VisitIncompleteArrayType is only a type, not a stmt).


------------------ Original ------------------

Oh sorry, I misunderstood your question. See
for an answer to almost exactly the same question. I'm pretty sure
that the getSizeExpr() will be null if there was none written.

-- Sean Silva