This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/70106] [4.9/5/6 Regression][C++11 or above] adding parenthesis [cerr << (var)] cause error: invalid static_cast from type 'const size_t {aka const long unsigned int}' to type 'size_t& {aka long unsigned int&}'
- From: "ppalka at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 12 Mar 2016 02:05:49 +0000
- Subject: [Bug c++/70106] [4.9/5/6 Regression][C++11 or above] adding parenthesis [cerr << (var)] cause error: invalid static_cast from type 'const size_t {aka const long unsigned int}' to type 'size_t& {aka long unsigned int&}'
- Auto-submitted: auto-generated
- References: <bug-70106-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70106
--- Comment #5 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Author: ppalka
Date: Sat Mar 12 02:05:17 2016
New Revision: 234159
URL: https://gcc.gnu.org/viewcvs?rev=234159&root=gcc&view=rev
Log:
Fix PR c++/70106 (type of parenthesized qualified-id has wrong cv-qualifiers)
gcc/cp/ChangeLog:
PR c++/70106
* semantics.c (force_paren_expr): Just build a PAREN_EXPR when
processing_template_decl and EXPR is a SCOPE_REF.
gcc/testsuite/ChangeLog:
PR c++/70106
* g++.dg/cpp1y/paren3.C: New test.
Added:
trunk/gcc/testsuite/g++.dg/cpp1y/paren3.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/semantics.c
trunk/gcc/testsuite/ChangeLog