[GCC-XML] Failed to compile pimpl idiom with up to date gccxml and boost's scoped_ptr

Brad King brad.king at kitware.com
Mon Jan 5 14:11:19 EST 2009


Kirill Lapshin wrote:
> Kirill Lapshin wrote:
> 
>> Another interesting observation is that we don't observe this problem
>> with older gccxml versions. Not sure when it was introduced -- I'll
>> try to pick some older version to see if it solves this problem.
> 
> I've tried to bisect, and it turned out that cvs version as of
> 2008-10-01 works fine, but as of 2008-10-02 fails. My guess (wild guess
> that is) that offending change is  GCC/gcc/cp/xml.c revision 1.124. Here
> is a courtesy copy of commit log message
> 
> revision 1.124
> date: 2008-10-01 19:08:24 +0400;  author: king;  state: Exp;  lines: +34
> -1;  commitid: 3grJQuAcjzu76Wkt;
> BUG: Suppress invalid compiler-generated methods
> 
> The GCC parser generates artificial declarations for methods that may be
> implicitly defined.  Unfortunately it does so even when the method is
> not supposed to be available, and waits until the code tries to call the
> method to report an error.  For example, the code
> 
>   struct A { A(); const int a; };
> 
> should not have an implicit assignment operator.  In order to drop these
> methods from the xml output, we test synthesizing them as if they were
> called.  During the test, error diagnostics are suppressed but used to
> discard the offending method.

This is certainly the cause.  The xml dump code is forcing the
synthesization of some implicit methods to see if they should really be
declared.  The change you mention suppresses the diagnostics from the
test synthesization.  The problem is that it does not also suppress
addition of the scoped_ptr destructor to the *pending* template
instantiation list inside GCC.  Then after the xml dump completes gcc
tries to instantiate the pending templates and gets the error (because
errors are no longer suppressed).  I've committed a fix that blocks
addition of pending templates during the test method synthesization.
Thanks for bisecting this.  It helped alot.

-Brad


/cvsroot/GCC_XML/gccxml/GCC/gcc/cp/pt.c,v  <--  GCC/gcc/cp/pt.c
new revision: 1.5; previous revision: 1.4
/cvsroot/GCC_XML/gccxml/GCC/gcc/diagnostic.c,v  <--  GCC/gcc/diagnostic.c
new revision: 1.4; previous revision: 1.3



More information about the gccxml mailing list