This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ODR merging and implicit typedefs


> I will take a look if I can improve type_in_anonymous_namepsace somehow.  So
> Ada produces TYPE_DECL with DECL_ABSTRACT that do have TYPE_STUB_DECL with
> TREE_PUBLIC NULL I suppose.

Do you mean DECL_ARTIFICIAL instead of DECL_ABSTRACT?  If so, presumably, yes, 
why wouldn't it do that?  That seems the natural description of an artificial 
private type with file scope.

And I don't really understand why DECL_ARTIFICIAL is allowed to make such a 
difference in semantics here.  That looks dangerous to me.


Note that the problematic assertions:

  gcc_assert (!type_with_linkage_p (t1) || !type_in_anonymous_namespace_p 
(t1));
  gcc_assert (!type_with_linkage_p (t2) || !type_in_anonymous_namespace_p 
(t2));

make the following code unreachable:

  if ((type_with_linkage_p (t1) && type_in_anonymous_namespace_p (t1))
      || (type_with_linkage_p (t2) && type_in_anonymous_namespace_p (t2)))
    {
      /* We can not trip this when comparing ODR types, only when trying to
	 match different ODR derivations from different declarations.
	 So WARN should be always false.  */
      gcc_assert (!warn);
      return false;
    }

-- 
Eric Botcazou


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]