[PATCH] c++: Fix hashing and testing for equality of ATOMIC_CONST_EXPRs
Jason Merrill
jason@redhat.com
Thu Feb 13 23:10:00 GMT 2020
On 2/12/20 5:15 PM, Patrick Palka wrote:
> Two equal atomic constraint expressions do not necessarily share the same tree,
> so we can't assume that two ATOMIC_CONST_EXPRs are equal if and only if they
> point to the same tree.
This is incorrect; comparison of atomic constraints is based on them
coming from the same actual tokens, which is why we use pointer comparison.
In your concepts-partial-spec7.C, test2 is properly rejected. If you
want to be able to write the same constraint in multiple places, you
need to use a concept.
13.5.1.2:
Two atomic constraints are identical if they are formed from the same
expression and the targets of the parameter mappings are equivalent
according to the rules for expressions described in 13.7.6.1.
Jason
More information about the Gcc-patches
mailing list