-
Notifications
You must be signed in to change notification settings - Fork 3
Fix compilation error #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)
It seems
test_component_set
must be fully specified as it is used as avalue of a map which is member of
processor
.