Fix condition in declare_cpp_class

Condition is no longer valid since commit fa3db3679bbb3385eb2746483a91ddbbf31b82f0