re PR c++/84348 (ICE with invalid friend declaration)
/cp 2018-02-19 Paolo Carlini <paolo.carlini@oracle.com> PR c++/84348 * decl.c (grokdeclarator): Early return error_mark_node upon ill-formed friend declaration. /testsuite 2018-02-19 Paolo Carlini <paolo.carlini@oracle.com> PR c++/84348 * g++.dg/cpp0x/auto50.C: New. * g++.dg/parse/friend12.C: Adjust. From-SVN: r257802
This commit is contained in:
parent
9f88a07b85
commit
50dbbe5357
@ -1,3 +1,9 @@
|
||||
2018-02-19 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/84348
|
||||
* decl.c (grokdeclarator): Early return error_mark_node upon
|
||||
ill-formed friend declaration.
|
||||
|
||||
2018-02-16 Marek Polacek <polacek@redhat.com>
|
||||
Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
|
@ -12141,7 +12141,7 @@ grokdeclarator (const cp_declarator *declarator,
|
||||
{
|
||||
error ("%qE is neither function nor member function; "
|
||||
"cannot be declared friend", unqualified_id);
|
||||
friendp = 0;
|
||||
return error_mark_node;
|
||||
}
|
||||
decl = NULL_TREE;
|
||||
}
|
||||
|
@ -1,3 +1,9 @@
|
||||
2018-02-19 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/84348
|
||||
* g++.dg/cpp0x/auto50.C: New.
|
||||
* g++.dg/parse/friend12.C: Adjust.
|
||||
|
||||
2018-02-18 Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
||||
|
||||
PR libgfortran/84389
|
||||
|
7
gcc/testsuite/g++.dg/cpp0x/auto50.C
Normal file
7
gcc/testsuite/g++.dg/cpp0x/auto50.C
Normal file
@ -0,0 +1,7 @@
|
||||
// PR c++/84348
|
||||
// { dg-do compile { target c++11 } }
|
||||
|
||||
template<typename> struct A
|
||||
{
|
||||
friend auto foo; // { dg-error "cannot be declared friend" }
|
||||
};
|
@ -3,5 +3,4 @@
|
||||
struct A
|
||||
{
|
||||
friend int i = 0; // { dg-error "cannot be declared friend" }
|
||||
// { dg-error "non-static data member" "" { target { ! c++11 } } .-1 }
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user