re PR c++/59766 (c++1y: declaring friend function with 'auto' return type deduction is rejected with bogus reason)
PR c++/59766 * decl.c (grokdeclarator): Do not flag friends with deduced return. From-SVN: r222095
This commit is contained in:
parent
2fd16d0f90
commit
688e531e4b
@ -1,3 +1,8 @@
|
||||
2015-04-14 David Krauss <david_work@me.com>
|
||||
|
||||
PR c++/59766
|
||||
* decl.c (grokdeclarator): Do not flag friends with deduced return.
|
||||
|
||||
2015-04-14 Momchil Velikov <momchil.velikov@gmail.com>
|
||||
Jason Merrill <jason@redhat.com>
|
||||
|
||||
|
@ -10628,7 +10628,7 @@ grokdeclarator (const cp_declarator *declarator,
|
||||
}
|
||||
else if (decl_context == FIELD)
|
||||
{
|
||||
if (!staticp && TREE_CODE (type) != METHOD_TYPE
|
||||
if (!staticp && !friendp && TREE_CODE (type) != METHOD_TYPE
|
||||
&& type_uses_auto (type))
|
||||
{
|
||||
error ("non-static data member declared %<auto%>");
|
||||
|
6
gcc/testsuite/g++.dg/cpp1y/auto-fn26.C
Normal file
6
gcc/testsuite/g++.dg/cpp1y/auto-fn26.C
Normal file
@ -0,0 +1,6 @@
|
||||
// PR c++/59766
|
||||
// { dg-do compile { target c++14 } }
|
||||
|
||||
struct T {
|
||||
friend auto f() { }
|
||||
};
|
Loading…
Reference in New Issue
Block a user