* decl.c (grokdeclarator): Disallow `explicit' in a friend declaration.
authorBrendan Kehoe <brendan@cygnus.com>
Mon, 26 Oct 1998 11:45:05 +0000 (11:45 +0000)
committerBrendan Kehoe <brendan@gcc.gnu.org>
Mon, 26 Oct 1998 11:45:05 +0000 (06:45 -0500)
From-SVN: r23349

gcc/cp/ChangeLog
gcc/cp/decl.c

index dd9fbe711219cd81a7955f304e4a003ac2481e79..8926b987dcbd43b8ef259208cc2a6b1282fc0ff0 100644 (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>
 
        * typeck2.c (process_init_constructor): Only skip anonymous fields
index 5769a8871f3906ab9b371cc8569cdfaf30af22a5..983b2d03b8f14d4f1fdd66b5c64b33d5f8ad0822 100644 (file)
@@ -9235,6 +9235,10 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
   friendp = RIDBIT_SETP (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 (decl_context == PARM)