Repository navigation
deps/v8/src/objects.h:3263:46: error: invalid use of incomplete type ‘class v8::internal::Heap #10388
Description
Activity
cc @nodejs/v8
@octoploid What node version?
Latest git branch master.
@octoploid what platform are you on?
/cc @hashseed
I'm running Linux. Let me quote the C++ std:
14.6/8: "If a hypothetical instantiation of a template immediately following its definition would be ill-formed due to a construct that does not depend on a template parameter, the program is ill-formed; no diagnostic is required. If the interpretation of such a construct in the hypothetical instantiation is different from the interpretation of the corresponding construct in any actual instantiation of the template, the program is ill-formed; no diagnostic is required.
[ Note: This can happen in situations including the following: * a type used in a non-dependent name is incomplete at the point at which a template is defined but is complete at the point at which an instantiation is performed, ....
% cat tc.ii
class Heap;
class A {
public:
Heap *m_fn1();
};
template <typename> class B : A {
void m_fn2() { m_fn1()->HashSeed; }
};
% g++ -c tc.ii
tc.ii: In member function ‘void B< <template-parameter-1-1> >::m_fn2()’:
tc.ii:7:25: error: invalid use of incomplete type ‘class Heap’
void m_fn2() { m_fn1()->HashSeed; }
^~
tc.ii:1:7: note: forward declaration of ‘class Heap’
class Heap;
^~~~
it should work by including heap.h into natives.h?
For the record, just including heap.h (or heap.h plus heap-inl.h) into natives.h does not result in a successful build.
Example: https://kojipkgs.fedoraproject.org//work/tasks/8811/17888811/build.log (note: this is a transient build and will be reaped in seven days)
Can someone take a look on this already?
New logs:
6.9.5: https://fedorapeople.org/~zvetlik/buildlogs/v695-gcc701build.log
6.10.0: https://fedorapeople.org/~zvetlik/buildlogs/v6100-gcc701build.log
Some small refactoring to move the code out of objects.h into objects-inl.h should hopefully fix this issue. I'll come up with a patch tomorrow.
g++ 6.3.1 works okay and I'm not adventurous enough to upgrade my FC25 box to Rawhide. Any suggestions?
g++ 6.3.1 works okay and I'm not adventurous enough to upgrade my FC25 box to Rawhide. Any suggestions?
On Fedora 25, you can do:
dnf install mock
Add your user to the mock group in /etc/group and log out and back in (so it takes effect).
Then you can do:
$ mock -r fedora-rawhide-x86_64 init
$ mock -r fedora-rawhide-x86_64 install <packages needed for building>
$ mock -r fedora-rawhide-x86_64 --copyin <src> <dest>
$ mock -r fedora-rawhide-x86_64 shell
Inside that chroot, you essentially have Fedora 26/Rawhide (running on the F25 kernel).
Compilation fails with gcc-7:
The code is ill formed (no diagnostic required) according the C++ standard.