diff options
author | fabien <fabien@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-12-28 19:53:14 +0000 |
---|---|---|
committer | fabien <fabien@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-12-28 19:53:14 +0000 |
commit | 9e92dfe55ae0ada40b85090045ee0fe70c6f1d6c (patch) | |
tree | a16ce4b7b64413e9f41169e494d59be61c2e57f7 /gcc/cp/name-lookup.c | |
parent | d5932b6529f14acb1e1cefd396a00d8f4e753199 (diff) | |
download | ppe42-gcc-9e92dfe55ae0ada40b85090045ee0fe70c6f1d6c.tar.gz ppe42-gcc-9e92dfe55ae0ada40b85090045ee0fe70c6f1d6c.zip |
gcc/testsuite/ChangeLog
2011-12-28 Fabien Chene <fabien@gcc.gnu.org>
PR c++/23211
* g++.dg/template/using18.C: New.
* g++.dg/template/using19.C: New.
* g++.dg/template/nested3.C: Remove dg-message at instantiation.
* g++.dg/template/crash13.C: Likewise.
gcc/cp/ChangeLog
2011-12-28 Fabien Chene <fabien@gcc.gnu.org>
PR c++/23211
* name-lookup.c (do_class_using_decl): Use dependent_scope_p
instead of dependent_type_p, to check that a non-dependent
nested-name-specifier of a class-scope using declaration refers to
a base, even if the current scope is dependent.
* parser.c (cp_parser_using_declaration): Set
USING_DECL_TYPENAME_P to 1 if the DECL is not null. Re-indent a
'else' close to the prior modification.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182711 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/name-lookup.c')
-rw-r--r-- | gcc/cp/name-lookup.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index ceecdef3e8d..5734055b103 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -3217,7 +3217,7 @@ do_class_using_decl (tree scope, tree name) return NULL_TREE; } - scope_dependent_p = dependent_type_p (scope); + scope_dependent_p = dependent_scope_p (scope); name_dependent_p = (scope_dependent_p || (IDENTIFIER_TYPENAME_P (name) && dependent_type_p (TREE_TYPE (name)))); @@ -3242,9 +3242,9 @@ do_class_using_decl (tree scope, tree name) In general, we cannot check this constraint in a template because we do not know the entire set of base classes of the current - class type. However, if all of the base classes are - non-dependent, then we can avoid delaying the check until - instantiation. */ + class type. Morover, if SCOPE is dependent, it might match a + non-dependent base. */ + if (!scope_dependent_p) { base_kind b_kind; @@ -3270,7 +3270,7 @@ do_class_using_decl (tree scope, tree name) if (BASELINK_P (decl)) decl = BASELINK_FUNCTIONS (decl); } - } + } value = build_lang_decl (USING_DECL, name, NULL_TREE); USING_DECL_DECLS (value) = decl; |