jniemann66/juddperft

Clang: expression of non-scalar type 'ChessMove [128]' cannot be used in a pseudo-destructor

kctess5 opened this issue · 1 comments

You mentioned this here: #6

With Clang:
error: object expression of non-scalar type 'juddperft::ChessMove [128]' cannot be used in a pseudo-destructor expression

I tracked this down to this particular line in the perftFastIterative function:

std::vector<ChessMove[MOVELIST_SIZE]> MoveList(depth + 1);

I think the problem is that vectors of arrays like this are pretty unusual. I wouldn't be surprised if this is either undefined compiler behavior land, or simply in conflict with the language spec.

Quickfix: comment the contents of the perftFastIterative function in search.cpp

Not sure the best long term solution, but maybe creating a wrapper class like "MoveList" would not be a terrible idea.

Cheers!

Any update on this? I recently got the same compilation warning.