c++: missing SFINAE with pointer subtraction [PR78173]
authorPatrick Palka <ppalka@redhat.com>
Fri, 11 Dec 2020 14:40:58 +0000 (09:40 -0500)
committerPatrick Palka <ppalka@redhat.com>
Fri, 11 Dec 2020 14:40:58 +0000 (09:40 -0500)
commit958d42abdf1a1936d290aab126cebd6bb4a52361
treecce0f5e412579a4dcdf3778c775735273c48da00
parent33314b11ca2ef1bacc1f5d82c58fae23a1d818ef
c++: missing SFINAE with pointer subtraction [PR78173]

This fixes a missed SFINAE when subtracting pointers to an incomplete
type.

gcc/cp/ChangeLog:

PR c++/78173
* typeck.c (pointer_diff): Use complete_type_or_maybe_complain
instead of complete_type_or_else.

gcc/testsuite/ChangeLog:

PR c++/78173
* g++.dg/cpp2a/concepts-pr78173.C: New test.
gcc/cp/typeck.c
gcc/testsuite/g++.dg/cpp2a/concepts-pr78173.C [new file with mode: 0644]