diff options
author | Ville Voutilainen <ville.voutilainen@gmail.com> | 2018-01-22 14:44:33 +0200 |
---|---|---|
committer | Ville Voutilainen <ville@gcc.gnu.org> | 2018-01-22 14:44:33 +0200 |
commit | 74e95ed04f70235f2f0a6de128369cf8b2bb8dcd (patch) | |
tree | e51f0f1407ce2cd1ab83bff385f3b2d0de7288b6 /gcc | |
parent | 0e32449b70d847d800e2ef8a6b433e8efb850b03 (diff) | |
download | gcc-74e95ed04f70235f2f0a6de128369cf8b2bb8dcd.zip gcc-74e95ed04f70235f2f0a6de128369cf8b2bb8dcd.tar.gz gcc-74e95ed04f70235f2f0a6de128369cf8b2bb8dcd.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/cp/decl.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/warn/83895.C | 7 |
3 files changed, 15 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 5bad14d..0652662 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +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> PR c++/81167 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 039ddd9..230e7dd 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -10882,6 +10882,7 @@ grokdeclarator (const cp_declarator *declarator, to be a constructor call. */ if (decl_context != PARM && decl_context != TYPENAME + && !typedef_p && declarator->parenthesized != UNKNOWN_LOCATION /* If the type is class-like and the inner name used a global namespace qualifier, we need the parens. diff --git a/gcc/testsuite/g++.dg/warn/83895.C b/gcc/testsuite/g++.dg/warn/83895.C new file mode 100644 index 0000000..86b317f --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/83895.C @@ -0,0 +1,7 @@ +// { dg-additional-options -Wparentheses } +// { dg-do compile { target c++11 } } + +struct X; + +typedef int (X::*foo); +using bar = int (X::*); |