aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl2.cc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2022-04-08 13:48:25 -0400
committerJason Merrill <jason@redhat.com>2022-04-29 17:25:03 -0400
commite9d2adc17d0dbe46db67e1b618dea888d5c7aca3 (patch)
tree5e62d35604cca84d2ef20450fc4c98cf468ec01b /gcc/cp/decl2.cc
parent4259c229b457361a9b5cdec157e058bf0c2c8b77 (diff)
downloadgcc-e9d2adc17d0dbe46db67e1b618dea888d5c7aca3.zip
gcc-e9d2adc17d0dbe46db67e1b618dea888d5c7aca3.tar.gz
gcc-e9d2adc17d0dbe46db67e1b618dea888d5c7aca3.tar.bz2
c++: reorganize friend template matching [PR91618]
The the different calling of check_explicit_specialization for class and namespace scope friends bothered me, so this patch combines them. PR c++/91618 PR c++/96604 gcc/cp/ChangeLog: * friend.cc (do_friend): Call check_explicit_specialization here. * decl.cc (grokdeclarator): Not here. * decl2.cc (check_classfn): Or here.
Diffstat (limited to 'gcc/cp/decl2.cc')
-rw-r--r--gcc/cp/decl2.cc9
1 files changed, 2 insertions, 7 deletions
diff --git a/gcc/cp/decl2.cc b/gcc/cp/decl2.cc
index d2b2920..ae743c8 100644
--- a/gcc/cp/decl2.cc
+++ b/gcc/cp/decl2.cc
@@ -799,14 +799,9 @@ check_classfn (tree ctype, tree function, tree template_parms)
is replaced with the specialization chosen by deduction from the
friend declaration or discarded if deduction fails."
- So ask check_explicit_specialization to find a matching template. */
+ So tell check_explicit_specialization to look for a match. */
SET_DECL_IMPLICIT_INSTANTIATION (function);
- tree spec = check_explicit_specialization (DECL_NAME (function),
- function, /* tcount */0,
- /* friend flag */4,
- /* attrlist */NULL_TREE);
- if (spec != error_mark_node)
- matched = spec;
+ matched = function;
}
if (!matched)