diff options
author | Brendan Kehoe <brendan@cygnus.com> | 1998-10-26 11:45:05 +0000 |
---|---|---|
committer | Brendan Kehoe <brendan@gcc.gnu.org> | 1998-10-26 06:45:05 -0500 |
commit | 7e83af848287ef9ba06d5afab7519e00805b2f45 (patch) | |
tree | 144c59926ccb47b3e4f502e4453d5ffe75bc269f /gcc | |
parent | 6004a083d4568d8e996fe48b20800e6d105d12e1 (diff) | |
download | gcc-7e83af848287ef9ba06d5afab7519e00805b2f45.zip gcc-7e83af848287ef9ba06d5afab7519e00805b2f45.tar.gz gcc-7e83af848287ef9ba06d5afab7519e00805b2f45.tar.bz2 |
* decl.c (grokdeclarator): Disallow `explicit' in a friend declaration.
From-SVN: r23349
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/decl.c | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index dd9fbe7..8926b98 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 5769a88..983b2d0 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -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) |