From: Jason Merrill Date: Thu, 4 Aug 2016 16:06:09 +0000 (-0400) Subject: PR c++/72796 - wrong resolution of scoped method call. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=99676625e65ff23339115525f01a4a7a82e8ac3a;p=gcc.git PR c++/72796 - wrong resolution of scoped method call. * typeck.c (finish_class_member_access_expr): Avoid stripping SCOPE_REF to dependent base. From-SVN: r239136 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 4c2b1157dfd..f8de78c97fa 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2016-08-04 Jason Merrill + + PR c++/72796 + * typeck.c (finish_class_member_access_expr): Avoid stripping + SCOPE_REF to dependent base. + 2016-08-04 Thomas Schwinge * parser.c (cp_ensure_no_oacc_routine): Improve diagnostics. diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index d4bfb112a53..78d443b1abf 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -2683,7 +2683,7 @@ finish_class_member_access_expr (cp_expr object, tree name, bool template_p, { dependent: return build_min_nt_loc (UNKNOWN_LOCATION, COMPONENT_REF, - orig_object, name, NULL_TREE); + orig_object, orig_name, NULL_TREE); } object = build_non_dependent_expr (object); } diff --git a/gcc/testsuite/g++.dg/template/dependent-base2.C b/gcc/testsuite/g++.dg/template/dependent-base2.C new file mode 100644 index 00000000000..b4188327021 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/dependent-base2.C @@ -0,0 +1,18 @@ +// PR c++/72796 +// { dg-do compile { target c++11 } } + +struct a; +template struct b { typedef a c; }; +struct d { + void e(int); +}; +struct a : d { + void e(int) = delete; +}; +template struct g : b::c { + g(int) { this->d::e(0); } +}; +struct h : g<0> { + using i = g; + h() : i(0) {} +};