diff options
author | Mark Mitchell <mark@codesourcery.com> | 2000-03-26 03:05:49 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2000-03-26 03:05:49 +0000 |
commit | da8a74562581602cb37afdc47dc1a5ef98c57893 (patch) | |
tree | 35b815d59f3ce8fc3b4194ebd61bc2efeef81624 /gcc | |
parent | 770ae6cc710a7a0f7db4ef7f09941bbe19d0ee78 (diff) | |
download | gcc-da8a74562581602cb37afdc47dc1a5ef98c57893.zip gcc-da8a74562581602cb37afdc47dc1a5ef98c57893.tar.gz gcc-da8a74562581602cb37afdc47dc1a5ef98c57893.tar.bz2 |
decl.c (grokdeclarator): Count partial specializations when keeping track of how many template classes...
* decl.c (grokdeclarator): Count partial specializations when
keeping track of how many template classes have been seen.
* dump.c (dequeue_and_dump): Dump DECL_TEMPLATE_RESULT.
From-SVN: r32743
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/cp/decl.c | 16 | ||||
-rw-r--r-- | gcc/cp/dump.c | 1 |
3 files changed, 22 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 63add6d..58c0323 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2000-03-25 Mark Mitchell <mark@codesourcery.com> + + * decl.c (grokdeclarator): Count partial specializations when + keeping track of how many template classes have been seen. + + * dump.c (dequeue_and_dump): Dump DECL_TEMPLATE_RESULT. + Sat Mar 25 09:12:10 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * class.c (build_vbase_pointer_fields): layout_field now place_field. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index ff2cf40..2a2ca15 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -10647,9 +10647,21 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist) t = ctype; while (t != NULL_TREE && CLASS_TYPE_P (t)) { - if (CLASSTYPE_TEMPLATE_INFO (t) && - !CLASSTYPE_TEMPLATE_SPECIALIZATION (t)) + /* You're supposed to have one `template <...>' + for every template class, but you don't need one + for a full specialization. For example: + + template <class T> struct S{}; + template <> struct S<int> { void f(); }; + void S<int>::f () {} + + is correct; there shouldn't be a `template <>' for + the definition of `S<int>::f'. */ + if (CLASSTYPE_TEMPLATE_INFO (t) + && (CLASSTYPE_TEMPLATE_INSTANTIATION (t) + || uses_template_parms (CLASSTYPE_TI_ARGS (t)))) template_count += 1; + t = TYPE_MAIN_DECL (t); if (DECL_LANG_SPECIFIC (t)) t = DECL_CONTEXT (t); diff --git a/gcc/cp/dump.c b/gcc/cp/dump.c index d66f217..fe43fb0 100644 --- a/gcc/cp/dump.c +++ b/gcc/cp/dump.c @@ -609,6 +609,7 @@ dequeue_and_dump (di) break; case TEMPLATE_DECL: + dump_child ("rslt", DECL_TEMPLATE_RESULT (t)); dump_child ("inst", DECL_TEMPLATE_INSTANTIATIONS (t)); dump_child ("spcs", DECL_TEMPLATE_SPECIALIZATIONS (t)); break; |