https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70822
--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> --- Author: jason Date: Thu Jul 21 06:29:32 2016 New Revision: 238578 URL: https://gcc.gnu.org/viewcvs?rev=238578&root=gcc&view=rev Log: Fix PR c++/70822 (bogus error with parenthesized SCOPE_REF) gcc/cp/ChangeLog: PR c++/70822 PR c++/70106 * cp-tree.h (REF_PARENTHESIZED_P): Make this flag apply to SCOPE_REFs too. * pt.c (tsubst_qualified_id): If REF_PARENTHESIZED_P is set on the qualified_id then propagate it to the resulting expression. (do_auto_deduction): Check REF_PARENTHESIZED_P on SCOPE_REFs too. * semantics.c (force_paren_expr): If given a SCOPE_REF, just set its REF_PARENTHESIZED_P flag. gcc/testsuite/ChangeLog: PR c++/70822 PR c++/70106 * g++.dg/cpp1y/auto-fn32.C: New test. * g++.dg/cpp1y/paren4.C: New test. Added: branches/gcc-6-branch/gcc/testsuite/g++.dg/cpp1y/auto-fn32.C branches/gcc-6-branch/gcc/testsuite/g++.dg/cpp1y/paren4.C Modified: branches/gcc-6-branch/gcc/cp/ChangeLog branches/gcc-6-branch/gcc/cp/cp-tree.h branches/gcc-6-branch/gcc/cp/pt.c branches/gcc-6-branch/gcc/cp/semantics.c branches/gcc-6-branch/gcc/testsuite/ChangeLog