diff options
author | Ville Voutilainen <ville.voutilainen@gmail.com> | 2014-08-12 20:06:11 +0300 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2014-08-12 13:06:11 -0400 |
commit | 253e34040c869ba73d0eca1d48895b147688ab29 (patch) | |
tree | 388aa403ff91bb1df810e0502a5a6c03a503779d /gcc/cp/friend.c | |
parent | caff45a63534858a06e9a8f4f1d878e25f5be88a (diff) | |
download | gcc-253e34040c869ba73d0eca1d48895b147688ab29.zip gcc-253e34040c869ba73d0eca1d48895b147688ab29.tar.gz gcc-253e34040c869ba73d0eca1d48895b147688ab29.tar.bz2 |
Reject virt-specifiers on friends and member templates
Reject virt-specifiers on friends and member templates
* friend.c (do_friend): Diagnose virt-specifiers.
* pt.c (push_template_decl_real): Diagnose virt-specifiers.
From-SVN: r213874
Diffstat (limited to 'gcc/cp/friend.c')
-rw-r--r-- | gcc/cp/friend.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/cp/friend.c b/gcc/cp/friend.c index a30918c..aa66c58 100644 --- a/gcc/cp/friend.c +++ b/gcc/cp/friend.c @@ -427,6 +427,10 @@ do_friend (tree ctype, tree declarator, tree decl, /* Every decl that gets here is a friend of something. */ DECL_FRIEND_P (decl) = 1; + if (DECL_OVERRIDE_P (decl) || DECL_FINAL_P (decl)) + error ("friend declaration %qD may not have virt-specifiers", + decl); + /* Unfortunately, we have to handle attributes here. Normally we would handle them in start_decl_1, but since this is a friend decl start_decl_1 never gets to see it. */ |