MantisBT - GCC-XML
View Issue Details
0010428GCC-XMLpublic2010-03-17 08:212010-04-23 11:59
Jakub Zytka 
Brad King 
normalmajoralways
closedfixed 
0010428: xml_find_template_parm encountered unsupported type component_ref/call_expr
I don't have simple example yet.
When i use gccxml (latest from cvs) i get:

xml_find_template_parm encountered unsupported type component_ref
xml_find_template_parm encountered unsupported type component_ref
xml_find_template_parm encountered unsupported type component_ref
xml_find_template_parm encountered unsupported type component_ref
xml_find_template_parm encountered unsupported type component_ref
xml_find_template_parm encountered unsupported type component_ref
xml_find_template_parm encountered unsupported type component_ref
xml_find_template_parm encountered unsupported type component_ref
xml_find_template_parm encountered unsupported type call_expr
blah.h:374: internal compiler error: in write_type, at cp/mangle.c:1649

this looks to be similar to bug 10183 (http://www.itk.org/Bug/view.php?id=10183 [^])
No tags attached.
patch 10428.patch (2,337) 2010-04-23 11:29
https://public.kitware.com/Bug/file/3061/10428.patch
Issue History
2010-03-17 08:21Jakub ZytkaNew Issue
2010-03-17 08:36Jakub ZytkaNote Added: 0019922
2010-03-19 08:47Brad KingStatusnew => assigned
2010-03-19 08:47Brad KingAssigned To => Brad King
2010-03-19 08:49Brad KingNote Added: 0019962
2010-04-07 11:32Jakub ZytkaNote Added: 0020090
2010-04-07 12:01Brad KingNote Added: 0020091
2010-04-23 11:29Jakub ZytkaFile Added: 10428.patch
2010-04-23 11:30Jakub ZytkaNote Added: 0020373
2010-04-23 11:58Brad KingNote Added: 0020374
2010-04-23 11:59Brad KingStatusassigned => closed
2010-04-23 11:59Brad KingResolutionopen => fixed

Notes
(0019922)
Jakub Zytka   
2010-03-17 08:36   
small example showing xml_find_template_parm encountered unsupported type call_expr problem:
#include <boost/function.hpp>

boost version 1.33.1
(0019962)
Brad King   
2010-03-19 08:49   
Look in GCC/gcc/cp/xml.c at the xml_find_template_parm function. It has a big switch on possible expression types. We'll need to add a case for COMPONENT_REF whose implementation strips down to any inner type and recurses.
(0020090)
Jakub Zytka   
2010-04-07 11:32   
Do you mean
case COMPONENT_REF: return xml_find_template_parm (TREE_TYPE (t));
or "stripping to any inner type" requires something more?

What about CALL_EXPR?

What is the semantics of xml_find_template_parm? When it should return 0 and when 1?
What does COMPONENT_REF stand for?

What would happen if i always return 1 for CALL_EXPR/COMPONENT_REF? Do i get only too big xml (adding some unnecessary template instantiations), or can the consequences be more serious?
(0020091)
Brad King   
2010-04-07 12:01   
> case COMPONENT_REF: return xml_find_template_parm (TREE_TYPE (t));

Yes.

> What about CALL_EXPR?

You need to recurse into its sub-expressions

> What is the semantics of xml_find_template_parm? When it should return 0 and when 1?

It detects whether any part of an expression still has a template parameter (rather than a real type substituted for it). The goal is to dump real template instantiations while avoiding some bogus ones that GCC's parser generates. Return 1 if a template parameter is found and 0 otherwise. I think all terminals in the expression grammar already return 0 or 1. All other node types have sub-expressions or sub-types into which we need to recurse.
(0020373)
Jakub Zytka   
2010-04-23 11:30   
Brad, could you please look at the patch attached and check if it looks ok? Thx.
(0020374)
Brad King   
2010-04-23 11:58   
Applied, thanks!

Handle call expressions in xml_find_template_parm
/cvsroot/GCC_XML/gccxml/GCC/gcc/cp/xml.c,v <-- GCC/gcc/cp/xml.c
new revision: 1.133; previous revision: 1.132