diff options
author | Mark Mitchell <mmitchel@gcc.gnu.org> | 2004-05-31 21:24:31 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2004-05-31 21:24:31 +0000 |
commit | c8b2e872a83dd3869ffc4443201a1f3096bc3a6c (patch) | |
tree | 5e0812c5ac7d5a81ea49d40fed31c165f91fb9df /gcc/cp/name-lookup.c | |
parent | 7c9fee34e5688d79d96db0e2b2e56d7273cb4335 (diff) | |
download | gcc-c8b2e872a83dd3869ffc4443201a1f3096bc3a6c.tar.gz |
re PR c++/15742 ('noreturn' attribute ignored in method of template functions.)
PR c++/15742
* call.c (build_over_call): Set
current_function_returns_abnormally even in template functions.
PR c++/15696
* cp-tree.h (invalid_nonstatic_memfn_p): New function.
* cvt.c (convert_to_void): Use it.
* typeck.c (invalid_nonstatic_memfn_p): New function.
(decay_conversion): Use it.
PR c++/15625
* pt.c (tsubst_decl): Set DECL_FRIEND_CONTEXT for instantiated
templates.
PR c++/15629
* name-lookup.c (arg_assoc_class): Do not find template
specializations.
PR c++/15209
* tree.c (lvalue_p_1): Only consider the right-hand side of "."
expressions when determining whether or not an express is packed.
PR c++/15742
* g++.dg/warn/Wreturn-1.C: New test.
PR c++/15696
* g++.dg/expr/ptrmem5.C: New test.
PR c++/15625
* g++.dg/template/friend27.C: New test.
PR c++/15629
* g++.dg/template/friend28.C: New test.
* g++.dg/template/friend.C: Do not depend on <iostream>. Add
error message.
PR c++/15209
* g++.dg/ext/packed3.C: Remove bogus error.
* g++.dg/ext/packed4.C: Remove bogus check.
* g++.dg/ext/packed6.C: New test.
From-SVN: r82499
Diffstat (limited to 'gcc/cp/name-lookup.c')
-rw-r--r-- | gcc/cp/name-lookup.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index 195070a8033..238023da877 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -4306,11 +4306,21 @@ arg_assoc_class (struct arg_lookup *k, tree type) if (k->name == FRIEND_NAME (list)) for (friends = FRIEND_DECLS (list); friends; friends = TREE_CHAIN (friends)) - /* Only interested in global functions with potentially hidden - (i.e. unqualified) declarations. */ - if (CP_DECL_CONTEXT (TREE_VALUE (friends)) == context) - if (add_function (k, TREE_VALUE (friends))) + { + tree fn = TREE_VALUE (friends); + + /* Only interested in global functions with potentially hidden + (i.e. unqualified) declarations. */ + if (CP_DECL_CONTEXT (fn) != context) + continue; + /* Template specializations are never found by name lookup. + (Templates themselves can be found, but not template + specializations.) */ + if (TREE_CODE (fn) == FUNCTION_DECL && DECL_USE_TEMPLATE (fn)) + continue; + if (add_function (k, fn)) return true; + } /* Process template arguments. */ if (CLASSTYPE_TEMPLATE_INFO (type) |