diff options
| author | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-08-01 18:48:50 +0000 |
|---|---|---|
| committer | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-08-01 18:48:50 +0000 |
| commit | c0b419db62bcd4ea0dfc10086ac18848e99b9bd3 (patch) | |
| tree | 11282088f2347ed5579eceafb21ff924a97c8da1 /gcc/cp/pt.c | |
| parent | 3bdb6310cafe44e2a6e80e8678aabc12f1898233 (diff) | |
| download | ppe42-gcc-c0b419db62bcd4ea0dfc10086ac18848e99b9bd3.tar.gz ppe42-gcc-c0b419db62bcd4ea0dfc10086ac18848e99b9bd3.zip | |
PR c++/11697
* decl.c (decls_match): Don't ignore the types of template
classes.
PR c++/11744
* pt.c (tsubst_copy_and_build): Refine Koenig lookup logic.
PR c++/11697
* g++.dg/template/using6.C: New test.
PR c++/11744
* g++.dg/template/koenig2.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@70062 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/pt.c')
| -rw-r--r-- | gcc/cp/pt.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index d2e6bf33f81..2c9668f94a8 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -8116,8 +8116,21 @@ tsubst_copy_and_build (tree t, tree function; tree call_args; bool qualified_p; + bool koenig_p; function = TREE_OPERAND (t, 0); + /* To determine whether or not we should perform Koenig lookup + we must look at the form of the FUNCTION. */ + koenig_p = !(/* Koenig lookup does not apply to qualified + names. */ + TREE_CODE (function) == SCOPE_REF + /* Or to references to members of classes. */ + || TREE_CODE (function) == COMPONENT_REF + /* If it is a FUNCTION_DECL or a baselink, then + the name was already resolved when the + template was parsed. */ + || TREE_CODE (function) == FUNCTION_DECL + || TREE_CODE (function) == BASELINK); if (TREE_CODE (function) == SCOPE_REF) { qualified_p = true; @@ -8140,7 +8153,7 @@ tsubst_copy_and_build (tree t, if (BASELINK_P (function)) qualified_p = 1; - if (!qualified_p + if (koenig_p && TREE_CODE (function) != TEMPLATE_ID_EXPR && (is_overloaded_fn (function) || DECL_P (function) |

