diff options
author | Jason Merrill <jason@redhat.com> | 2009-11-13 09:40:22 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2009-11-13 09:40:22 -0500 |
commit | ab11c13ff3e5507db92f789582b6f4e2a70569f3 (patch) | |
tree | 1b08b7541658aef356af4cb37413b3d84fb1cc9a /gcc/cp | |
parent | fc1e08468e6e828266648443e01c61e213aa33a8 (diff) | |
download | gcc-ab11c13ff3e5507db92f789582b6f4e2a70569f3.zip gcc-ab11c13ff3e5507db92f789582b6f4e2a70569f3.tar.gz gcc-ab11c13ff3e5507db92f789582b6f4e2a70569f3.tar.bz2 |
PR c++/21008, DR 515
PR c++/21008, DR 515
* semantics.c (finish_non_static_data_member): Don't check
derivation in a template.
From-SVN: r154150
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/semantics.c | 17 |
2 files changed, 12 insertions, 9 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 1ffa86a..b148d23 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 2009-11-13 Jason Merrill <jason@redhat.com> + PR c++/21008, DR 515 + * semantics.c (finish_non_static_data_member): Don't check + derivation in a template. + PR c++/11987 * parser.c (cp_parser_direct_declarator): Give helpful error about trying to define member of a dependent typedef. diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index e270a73..c1df24b 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -1485,6 +1485,14 @@ finish_non_static_data_member (tree decl, tree object, tree qualifying_scope) return build_min (COMPONENT_REF, type, object, decl, NULL_TREE); } + /* If PROCESSING_TEMPLATE_DECL is nonzero here, then + QUALIFYING_SCOPE is also non-null. Wrap this in a SCOPE_REF + for now. */ + else if (processing_template_decl) + return build_qualified_name (TREE_TYPE (decl), + qualifying_scope, + DECL_NAME (decl), + /*template_p=*/false); else { tree access_type = TREE_TYPE (object); @@ -1504,15 +1512,6 @@ finish_non_static_data_member (tree decl, tree object, tree qualifying_scope) } } - /* If PROCESSING_TEMPLATE_DECL is nonzero here, then - QUALIFYING_SCOPE is also non-null. Wrap this in a SCOPE_REF - for now. */ - if (processing_template_decl) - return build_qualified_name (TREE_TYPE (decl), - qualifying_scope, - DECL_NAME (decl), - /*template_p=*/false); - perform_or_defer_access_check (TYPE_BINFO (access_type), decl, decl); |