Open
Conversation
It seems `test_component_set` must be fully specified as it is used as a value of a map which is member of `processor`.
| #include <filesystem> | ||
| #include <string> | ||
| #include <unordered_map> | ||
| #include "test_component_set.hpp" |
Collaborator
There was a problem hiding this comment.
@ldonoso
test_component is used inside
using test_case_container = std::unordered_map<std::string, test_component_set>;
For some reason I assumed that forward declaration was enough for unordered_map. At least it sounded logical to me - internally each bucket should contain a single linked list of test_component_set and for slist forward declaration is enough. However, I haven't found anything in the standard regarding such requirement.
So, this behavior could be cpp library implementation defined.
Could you specify which compiler/version you were using.
Author
There was a problem hiding this comment.
Hmmm, I am not sure whether is required or not but my compiler requires it:
/home/ldonoso/src/mtr-checker/src/processor.hpp:19:23: required from here
/usr/include/c++/9/bits/stl_pair.h:215:11: error: ‘std::pair<_T1, _T2>::second’ has incomplete type
215 | _T2 second; /// @c second is a copy of the second object
| ^~~~~~
In file included from /home/ldonoso/src/mtr-checker/src/mtr_checker.cpp:8:
/home/ldonoso/src/mtr-checker/src/processor.hpp:9:7: note: forward declaration of ‘class test_component_set’
9 | class test_component_set;
| ^~~~~~~~~~~~~~~~~~
make[2]: *** [src/CMakeFiles/mtr_checker.dir/build.make:63: src/CMakeFiles/mtr_checker.dir/mtr_checker.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:94: src/CMakeFiles/mtr_checker.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
Please, find next the version:
Using built-in specs.
COLLECT_GCC=/usr/bin/g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.3.0-17ubuntu1~20.04' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-HskZEa/gcc-9-9.3.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
It seems
test_component_setmust be fully specified as it is used as avalue of a map which is member of
processor.