Re: [gcc libcc1] build_qualified_type for self-referencing/incomplete types

Jan Kratochvil <[email protected]>
Newsgroups gmane.comp.gdb.devel,gmane.comp.gcc.devel
Message-ID <[email protected]>
On Fri, 10 Apr 2015 14:31:45 +0200, Jan Kratochvil wrote:
> What is the recommended fix?  I expect pointer to a declaration / opaque type
> which gets completed only when one references the 'p' field later?

It looks as it got fixed by:

-plugin_build_record_type (cc1_plugin::connection *self)
+plugin_build_record_type (cc1_plugin::connection *self, const char *name)
 {
   plugin_context *ctx = static_cast<plugin_context *> (self);
-  return convert_out (ctx->preserve (make_node (RECORD_TYPE)));
+  tree node (make_node (RECORD_TYPE));
+  tree type_decl (build_decl (input_location, TYPE_DECL, get_identifier (name),
+                             node));
+  TYPE_NAME (node) = type_decl;
+  TYPE_STUB_DECL (node) = type_decl;
+  C_TYPE_BEING_DEFINED (node) = 1;
+  return convert_out (ctx->preserve (node));


Jan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.