From e4ac42e243f6cb0cb92f4bf19560eddfda62bba0 Mon Sep 17 00:00:00 2001 From: pinskia Date: Fri, 18 Feb 2005 19:11:58 +0000 Subject: 2005-01-20 Giovanni Bajo PR c++/19508 * g++.dg/ext/attrib20.C: New test. 2005-01-20 Giovanni Bajo PR c++/19508 * decl2.c (grokfield): Do not apply attributes to template parameters as they are ignored by tsubst anyway. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@95230 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/decl2.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'gcc/cp/decl2.c') diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index c7b04150e8f..113386a880f 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -878,7 +878,16 @@ grokfield (const cp_declarator *declarator, value = push_template_decl (value); if (attrlist) - cplus_decl_attributes (&value, attrlist, 0); + { + /* Avoid storing attributes in template parameters: + tsubst is not ready to handle them. */ + tree type = TREE_TYPE (value); + if (TREE_CODE (type) == TEMPLATE_TYPE_PARM + || TREE_CODE (type) == BOUND_TEMPLATE_TEMPLATE_PARM) + sorry ("applying attributes to template parameters is not implemented"); + else + cplus_decl_attributes (&value, attrlist, 0); + } return value; } -- cgit v1.2.1