* 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 dd9fbe7..8926b98 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 5769a88..983b2d0 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)