* decl.c (grokdeclarator): Disallow `explicit' in a friend declaration.

From-SVN: r23349
This commit is contained in:
Brendan Kehoe 1998-10-26 11:45:05 +00:00 committed by Brendan Kehoe
parent 6004a083d4
commit 7e83af8482
2 changed files with 8 additions and 0 deletions

View File

@ -1,3 +1,7 @@
1998-10-26 Brendan Kehoe <brendan@cygnus.com>
* decl.c (grokdeclarator): Disallow `explicit' in a friend declaration.
1998-10-26 Jason Merrill <jason@yorick.cygnus.com> 1998-10-26 Jason Merrill <jason@yorick.cygnus.com>
* typeck2.c (process_init_constructor): Only skip anonymous fields * typeck2.c (process_init_constructor): Only skip anonymous fields

View File

@ -9235,6 +9235,10 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
friendp = RIDBIT_SETP (RID_FRIEND, specbits); friendp = RIDBIT_SETP (RID_FRIEND, specbits);
RIDBIT_RESET (RID_FRIEND, specbits); RIDBIT_RESET (RID_FRIEND, specbits);
/* $7.1.2, Function specifiers */
if (friendp && explicitp)
error ("only declarations of constructors can be `explicit'");
if (RIDBIT_SETP (RID_MUTABLE, specbits)) if (RIDBIT_SETP (RID_MUTABLE, specbits))
{ {
if (decl_context == PARM) if (decl_context == PARM)