Fix compilation of foo.h: include <string>#19
Merged
ryanofsky merged 1 commit intobitcoin-core:masterfrom Jan 17, 2020
Merged
Conversation
std::string is used inside foo.h but it forgot to include the
corresponding header:
```
[ 53%] Building CXX object CMakeFiles/mptest.dir/src/mp/test/foo.capnp.proxy-server.c++.o
/usr/bin/c++ -I/usr/local/lib/cmake/CapnProto/../../../include -IBUILD/libmultiprocess/include -ISOURCE/libmultiprocess/include -ISOURCE/libmultiprocess/src -IBUILD/libmultiprocess/src -isystem /usr/local/include -D_THREAD_SAFE -pthread -std=gnu++14 -o CMakeFiles/mptest.dir/src/mp/test/foo.capnp.proxy-server.c++.o -c BUILD/libmultiprocess/src/mp/test/foo.capnp.proxy-server.c++
In file included from BUILD/libmultiprocess/src/mp/test/foo.capnp.proxy-server.c++:3:
In file included from BUILD/libmultiprocess/src/mp/test/foo.capnp.proxy-types.h:6:
In file included from BUILD/libmultiprocess/src/mp/test/foo.capnp.proxy.h:7:
SOURCE/libmultiprocess/src/mp/test/foo.h:17:17: error: implicit
instantiation of undefined template 'std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> >'
std::string name;
^
/usr/include/c++/v1/iosfwd:210:32: note: template is declared here
class _LIBCPP_TEMPLATE_VIS basic_string;
^
1 error generated.
...
$ c++ --version
FreeBSD clang version 8.0.1 (tags/RELEASE_801/final 366581) (based on LLVM 8.0.1)
Target: x86_64-unknown-freebsd12.1
Thread model: posix
InstalledDir: /usr/bin
```
Collaborator
|
Code review ACK c92112a. Good catch, a missing include also caused some problems for me in #16 (comment). A long time ago I had IWYU working on this code. I should probably get that working again to avoid more bugs like these. |
ryanofsky
added a commit
that referenced
this pull request
Jan 17, 2020
c92112a Fix compilation of foo.h: include <string> (Vasil Dimov) Pull request description: std::string is used inside foo.h but it forgot to include the corresponding header: ``` [ 53%] Building CXX object CMakeFiles/mptest.dir/src/mp/test/foo.capnp.proxy-server.c++.o /usr/bin/c++ -I/usr/local/lib/cmake/CapnProto/../../../include -IBUILD/libmultiprocess/include -ISOURCE/libmultiprocess/include -ISOURCE/libmultiprocess/src -IBUILD/libmultiprocess/src -isystem /usr/local/include -D_THREAD_SAFE -pthread -std=gnu++14 -o CMakeFiles/mptest.dir/src/mp/test/foo.capnp.proxy-server.c++.o -c BUILD/libmultiprocess/src/mp/test/foo.capnp.proxy-server.c++ In file included from BUILD/libmultiprocess/src/mp/test/foo.capnp.proxy-server.c++:3: In file included from BUILD/libmultiprocess/src/mp/test/foo.capnp.proxy-types.h:6: In file included from BUILD/libmultiprocess/src/mp/test/foo.capnp.proxy.h:7: SOURCE/libmultiprocess/src/mp/test/foo.h:17:17: error: implicit instantiation of undefined template 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >' std::string name; ^ /usr/include/c++/v1/iosfwd:210:32: note: template is declared here class _LIBCPP_TEMPLATE_VIS basic_string; ^ 1 error generated. ... $ c++ --version FreeBSD clang version 8.0.1 (tags/RELEASE_801/final 366581) (based on LLVM 8.0.1) Target: x86_64-unknown-freebsd12.1 Thread model: posix InstalledDir: /usr/bin ``` ACKs for top commit: ryanofsky: Code review ACK c92112a. Tree-SHA512: bac665541932d826e5c0ed2881860c3d011a041699c6005af5266bb27e82b3961646375e16c329a0b2b7c29214cdd4397a8aaabf7ca2c03efa2413e9cc9b9ca4
Contributor
Author
#20 Integrate iwyu |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
std::string is used inside foo.h but it forgot to include the
corresponding header: