PR c++/83592
* decl.c (grokdeclarator): Don't warn about MVP in typename context.
* g++.dg/warn/mvp2.C: New test.
From-SVN: r256176
+2018-01-03 Marek Polacek <polacek@redhat.com>
+
+ PR c++/83592
+ * decl.c (grokdeclarator): Don't warn about MVP in typename context.
+
2018-01-03 Jakub Jelinek <jakub@redhat.com>
PR preprocessor/83602
inner_declarator = declarator->declarator;
- /* We don't want to warn in parmeter context because we don't
+ /* We don't want to warn in parameter context because we don't
yet know if the parse will succeed, and this might turn out
to be a constructor call. */
if (decl_context != PARM
+ && decl_context != TYPENAME
&& declarator->parenthesized != UNKNOWN_LOCATION
/* If the type is class-like and the inner name used a
global namespace qualifier, we need the parens.
+2018-01-03 Marek Polacek <polacek@redhat.com>
+
+ PR c++/83592
+ * g++.dg/warn/mvp2.C: New test.
+
2018-01-03 Jakub Jelinek <jakub@redhat.com>
PR preprocessor/83602
--- /dev/null
+// PR c++/83592
+// { dg-do compile }
+// { dg-options "-Wparentheses" }
+
+// Test that -Wparentheses does not give bogus warnings in
+// typename context.
+
+int *
+foo (long &a)
+{
+ return reinterpret_cast<int (*)> (&a);
+}
+
+int *
+bar (long &a)
+{
+ return (int (*)) &a;
+}
+
+int *
+baz (int &a)
+{
+ return static_cast<int (*const)> (&a);
+}