aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorPatrick Palka <ppalka@redhat.com>2020-12-11 09:40:58 -0500
committerPatrick Palka <ppalka@redhat.com>2020-12-11 09:40:58 -0500
commit958d42abdf1a1936d290aab126cebd6bb4a52361 (patch)
treecce0f5e412579a4dcdf3778c775735273c48da00 /gcc/cp
parent33314b11ca2ef1bacc1f5d82c58fae23a1d818ef (diff)
downloadgcc-958d42abdf1a1936d290aab126cebd6bb4a52361.zip
gcc-958d42abdf1a1936d290aab126cebd6bb4a52361.tar.gz
gcc-958d42abdf1a1936d290aab126cebd6bb4a52361.tar.bz2
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.
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/typeck.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index afbb8ef..a650581 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -5984,7 +5984,7 @@ pointer_diff (location_t loc, tree op0, tree op1, tree ptrtype,
tree restype = ptrdiff_type_node;
tree target_type = TREE_TYPE (ptrtype);
- if (!complete_type_or_else (target_type, NULL_TREE))
+ if (!complete_type_or_maybe_complain (target_type, NULL_TREE, complain))
return error_mark_node;
if (VOID_TYPE_P (target_type))