Fix a missing include of <string>

Message ID 790a2269-494e-a6b8-8c05-977689c4b175@suse.cz
State New
Headers show
Series
  • Fix a missing include of <string>
Related show

Commit Message

Martin Liška June 7, 2019, 5:38 a.m.
Hi.

Since GCC revision r272011 I see following error:

make[9]: Entering directory '/home/marxin/Programming/binutils/gdb/gdbserver/build-gnulib-gdbserver/import'
In file included from debug.h:29,
                 from dirsearch.cc:31:
errors.h:87:50: error: ‘string’ in namespace ‘std’ does not name a type
   87 |   undefined_symbol(const Symbol* sym, const std::string& location);
      |                                                  ^~~~~~
errors.h:29:1: note: ‘std::string’ is defined in header ‘<string>’; did you forget to ‘#include <string>’?
   28 | #include "gold-threads.h"
  +++ |+#include <string>
   29 | 

The patch is fixing that.

Ready for trunk?
Thanks,
Martin

Comments

Richard Sandiford June 10, 2019, 9:11 a.m. | #1
Martin Liška <mliska@suse.cz> writes:
> Hi.

>

> Since GCC revision r272011 I see following error:

>

> make[9]: Entering directory '/home/marxin/Programming/binutils/gdb/gdbserver/build-gnulib-gdbserver/import'

> In file included from debug.h:29,

>                  from dirsearch.cc:31:

> errors.h:87:50: error: ‘string’ in namespace ‘std’ does not name a type

>    87 |   undefined_symbol(const Symbol* sym, const std::string& location);

>       |                                                  ^~~~~~

> errors.h:29:1: note: ‘std::string’ is defined in header ‘<string>’; did you forget to ‘#include <string>’?

>    28 | #include "gold-threads.h"

>   +++ |+#include <string>

>    29 | 

>

> The patch is fixing that.

>

> Ready for trunk?

> Thanks,

> Martin

>

> From cacc480584d4316ec7322618e4435f6a0faab9f2 Mon Sep 17 00:00:00 2001

> From: Martin Liska <mliska@suse.cz>

> Date: Fri, 7 Jun 2019 07:36:52 +0200

> Subject: [PATCH] Fix a missing include of <string>

>

> gold/ChangeLog:

>

> 2019-06-07  Martin Liska  <mliska@suse.cz>

>

> 	* errors.h: Include string.


OK, thanks.

Richard

> ---

>  gold/errors.h | 1 +

>  1 file changed, 1 insertion(+)

>

> diff --git a/gold/errors.h b/gold/errors.h

> index c26b558637..ac681e965b 100644

> --- a/gold/errors.h

> +++ b/gold/errors.h

> @@ -24,6 +24,7 @@

>  #define GOLD_ERRORS_H

>  

>  #include <cstdarg>

> +#include <string>

>  

>  #include "gold-threads.h"

Patch

From cacc480584d4316ec7322618e4435f6a0faab9f2 Mon Sep 17 00:00:00 2001
From: Martin Liska <mliska@suse.cz>
Date: Fri, 7 Jun 2019 07:36:52 +0200
Subject: [PATCH] Fix a missing include of <string>

gold/ChangeLog:

2019-06-07  Martin Liska  <mliska@suse.cz>

	* errors.h: Include string.
---
 gold/errors.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gold/errors.h b/gold/errors.h
index c26b558637..ac681e965b 100644
--- a/gold/errors.h
+++ b/gold/errors.h
@@ -24,6 +24,7 @@ 
 #define GOLD_ERRORS_H
 
 #include <cstdarg>
+#include <string>
 
 #include "gold-threads.h"
 
-- 
2.21.0