aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl2.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2006-05-17 21:39:07 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2006-05-17 21:39:07 +0000
commitceacde632a2d17c3c15a11da9c307647fac95ba8 (patch)
treedaeb99f7f4633316f25dd268423f148742b7d42e /gcc/cp/decl2.c
parentc89833429b5b5b63c8ff243ce9abd84efc0c1ec7 (diff)
downloadgcc-ceacde632a2d17c3c15a11da9c307647fac95ba8.zip
gcc-ceacde632a2d17c3c15a11da9c307647fac95ba8.tar.gz
gcc-ceacde632a2d17c3c15a11da9c307647fac95ba8.tar.bz2
re PR c++/26122 (Pure specifiers for templates causing trouble)
PR c++/26122 * decl2.c (check_member_template): Remove checks for virtual functions. * parser.c (cp_parser_function_specifier_opt): Complain about virtual templates. (cp_parser_pure_specifier): Likewise. PR c++/26122 * g++.old-deja/g++.oliva/template9.C: Remove XFAIL. From-SVN: r113873
Diffstat (limited to 'gcc/cp/decl2.c')
-rw-r--r--gcc/cp/decl2.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index f75c4ab..27b88f0 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -452,16 +452,9 @@ check_member_template (tree tmpl)
error ("invalid declaration of member template %q#D in local class",
decl);
- if (TREE_CODE (decl) == FUNCTION_DECL && DECL_VIRTUAL_P (decl))
- {
- /* 14.5.2.3 [temp.mem]
-
- A member function template shall not be virtual. */
- error
- ("invalid use of %<virtual%> in template declaration of %q#D",
- decl);
- DECL_VIRTUAL_P (decl) = 0;
- }
+ /* The parser rejects any use of virtual in a function template. */
+ gcc_assert (!(TREE_CODE (decl) == FUNCTION_DECL
+ && DECL_VIRTUAL_P (decl)));
/* The debug-information generating code doesn't know what to do
with member templates. */