diff options
author | pinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-02-18 19:11:58 +0000 |
---|---|---|
committer | pinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-02-18 19:11:58 +0000 |
commit | e4ac42e243f6cb0cb92f4bf19560eddfda62bba0 (patch) | |
tree | c9e53c3d1b5552f20cf65784987f33ce34aad1bd /gcc/cp/decl2.c | |
parent | a9dd2464a0e9e57fee758a3345a029bdc63edf1f (diff) | |
download | gcc-e4ac42e243f6cb0cb92f4bf19560eddfda62bba0.tar.gz |
2005-01-20 Giovanni Bajo <giovannibajo@gcc.gnu.org>
PR c++/19508
* g++.dg/ext/attrib20.C: New test.
2005-01-20 Giovanni Bajo <giovannibajo@gcc.gnu.org>
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
Diffstat (limited to 'gcc/cp/decl2.c')
-rw-r--r-- | gcc/cp/decl2.c | 11 |
1 files changed, 10 insertions, 1 deletions
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; } |