> >though. > > + if (((TREE_CODE (t) == ENUMERAL_TYPE && COMPLETE_TYPE_P (t)) > + || TREE_CODE (t) == INTEGER_TYPE > + || TREE_CODE (t) == BOOLEAN_TYPE > + || TREE_CODE (t) == REAL_TYPE > + || TREE_CODE (t) == FIXED_POINT_TYPE) > + && (TYPE_MAX_VALUE (t) != TYPE_MAX_VALUE (tv) > + || TYPE_MAX_VALUE (t) != TYPE_MAX_VALUE (tv))) > + { > + error ("type variant has different TYPE_MIN_VALUE"); > + debug_tree (tv); > + return false; > + } > > The second || check of TYPE_MAX_VALUE should probably be something else, > maybe TYPE_MIN_VALUE ? > > Why don't we warn about such useless || where both hands are identical? :)
Thanks for both corrections! Something I crept in at last moment when restructuring the code (I want to re-use the variant checking for ODR varaints and also in limited form for canonical types - combined with existing code to verify canonical type sanity in C++ FE) Yep, warning would be cute, though it may be bit hard to interpret when the tests are produced by different maco expansions/inlines. Honza > > Thanks, > > > >Honza >