Commit 74e95ed0 by Ville Voutilainen Committed by Ville Voutilainen

re PR c++/83895 (-Wparentheses warns about pointer-to-member typedefs)

PR c++/83895

cp/

* decl.c (grokdeclarator): Don't diagnose extra parens
on typedefs.

testsuite/

* g++.dg/warn/83895.C: New.

From-SVN: r256942
parent 0e32449b
2018-01-22 Ville Voutilainen <ville.voutilainen@gmail.com>
PR c++/83895
* decl.c (grokdeclarator): Don't diagnose extra parens
on typedefs.
2018-01-19 Jakub Jelinek <jakub@redhat.com> 2018-01-19 Jakub Jelinek <jakub@redhat.com>
PR c++/81167 PR c++/81167
......
...@@ -10882,6 +10882,7 @@ grokdeclarator (const cp_declarator *declarator, ...@@ -10882,6 +10882,7 @@ grokdeclarator (const cp_declarator *declarator,
to be a constructor call. */ to be a constructor call. */
if (decl_context != PARM if (decl_context != PARM
&& decl_context != TYPENAME && decl_context != TYPENAME
&& !typedef_p
&& declarator->parenthesized != UNKNOWN_LOCATION && declarator->parenthesized != UNKNOWN_LOCATION
/* If the type is class-like and the inner name used a /* If the type is class-like and the inner name used a
global namespace qualifier, we need the parens. global namespace qualifier, we need the parens.
......
// { dg-additional-options -Wparentheses }
// { dg-do compile { target c++11 } }
struct X;
typedef int (X::*foo);
using bar = int (X::*);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment