Fix pt.c bootstrap breakage

Message ID CAGWvnyky17rtN9iQCeJ=FF1kGb+WSHQL39R-pwbZNLnLExXn-w@mail.gmail.com
State New
Headers show
Series
  • Fix pt.c bootstrap breakage
Related show

Commit Message

David Edelsohn Feb. 27, 2018, 11:27 p.m.
The recent change to pt.c broke bootstrap by including C++ header file
<string> directly and including it first.  This patch changes to the
necessary method which includes the header file via system.h.

Okay?

Thanks, David

* pt.c: Don't include string. Define INCLUDE_STRING before system.h.

Comments

Richard Biener Feb. 28, 2018, 10:21 a.m. | #1
On Wed, Feb 28, 2018 at 12:27 AM, David Edelsohn <dje.gcc@gmail.com> wrote:
> The recent change to pt.c broke bootstrap by including C++ header file

> <string> directly and including it first.  This patch changes to the

> necessary method which includes the header file via system.h.

>

> Okay?


Ok.  But in reality nobody should use std::string ...

> Thanks, David

>

> * pt.c: Don't include string. Define INCLUDE_STRING before system.h.

>

> Index: pt.c

> ===================================================================

> --- pt.c        (revision 258045)

> +++ pt.c        (working copy)

> @@ -24,8 +24,8 @@

>       all methods must be provided in header files; can't use a source

>       file that contains only the method templates and "just win".  */

>

> -#include <string>

>  #include "config.h"

> +#define INCLUDE_STRING

>  #include "system.h"

>  #include "coretypes.h"

>  #include "cp-tree.h"

Patch

Index: pt.c
===================================================================
--- pt.c        (revision 258045)
+++ pt.c        (working copy)
@@ -24,8 +24,8 @@ 
      all methods must be provided in header files; can't use a source
      file that contains only the method templates and "just win".  */

-#include <string>
 #include "config.h"
+#define INCLUDE_STRING
 #include "system.h"
 #include "coretypes.h"
 #include "cp-tree.h"