You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Loading A.sl
Processing macro.cc...
In file included from ADictUX dictionary payload:6:
./B.h:5:18: error: base class has incomplete type
class B : public A {
~~~~~~~^
./A.h:5:7: note: definition of 'A' is not complete until the closing '}'
class A {
^
In file included from ADictUX dictionary payload:6:
./B.h:7:15: error: type 'A' is not a direct or virtual base of 'B'
B(int arg) : A(arg) {}
^
Error in <TInterpreter::AutoParse>: Error parsing payload code for class A with content:
#line 1 "ADictUX dictionary payload"
#define _BACKWARD_BACKWARD_WARNING_H
// Inline headers
#include "A.h"
#include "B.h"
#undef _BACKWARD_BACKWARD_WARNING_H
Error in <TInterpreter::AutoParse>: Error parsing payload code for class B with content:
#line 1 "ADictUX dictionary payload"
#define _BACKWARD_BACKWARD_WARNING_H
// Inline headers
#include "A.h"
#include "B.h"
#undef _BACKWARD_BACKWARD_WARNING_H
What is the expected behaviour?
The correct output is:
Loading A.sl
Processing macro.cc...
init A with arg=0
test A
init A with arg=0
test A
How to reproduce?
unzip linker_example.zip
make
root.exe -b -q -q macro.cc
ROOT version
Any v6 version
How did you install ROOT?
any
Which operating system are you using?
linux
Additional context
The problem might have been introduced by commit 3081bf5. In particular applying this diff 'fixes' the problem:
diff --git a/core/dictgen/src/rootcling_impl.cxx b/core/dictgen/src/rootcling_impl.cxx
index f56ce23b7a..7cd24d2c63 100644
--- a/core/dictgen/src/rootcling_impl.cxx
+++ b/core/dictgen/src/rootcling_impl.cxx
@@ -4971,7 +4971,7 @@ int RootClingMain(int argc,
if (!gOptCxxModule) {
headersClassesMapString = GenerateStringFromHeadersForClasses(headersDeclsMap,
detectedUmbrella,
- true);
+ false);
if (!gDriverConfig->fBuildingROOTStage1) {
if (!gOptWriteEmptyRootPCM)
fwdDeclsString = GenerateFwdDeclString(scan, interp);
This introduces the following diff in the generated dictionary:
and indeed in practice the order of operation are as follow: (macro.cc contains a #include "A.h"):
Process the A.h and then start declaring class A:
While declaring A, process the constructor (of anything involving A itself in A declaration and call TCling::AutoParse
TCling::AutoParse recognizes A for the dictionary's classesHeaders
TCling::AutoParse proceeed to ask for the payloadCode to be processed/included (with the 'patch / fix / reversal' this is replaced by A.h), this payloadCode consist of:
#include "A.h"
#include "B.h"
Thanks to the code guard A.h is skipped (well anyway it is actually being processed by the outer code !!)
B.h is being included is reached:
class B : public A
which correctly complains that A is not yet fully declared ....
The commit log corresponding to the change is explicitly referring to this change:
Associate to autoParse entries only the payload ([ROOT-6321](https://sft.its.cern.ch/jira/browse/ROOT-6321))
de facto implementing lazy payload parsing instead of header
parsing on demand.
It is not clear why TCling::AutoParse is called with a symbol that is "being" declared.
A work around (why we don't usually see this issue) is to generate a rootmap file (generating the c++ module should also in principle):
Check duplicate issues.
Describe the bug
Using the example provide in the original report : linker_example.zip
Doing:
leads to:
What is the expected behaviour?
The correct output is:
How to reproduce?
ROOT version
Any v6 version
How did you install ROOT?
any
Which operating system are you using?
linux
Additional context
The problem might have been introduced by commit 3081bf5. In particular applying this diff 'fixes' the problem:
This introduces the following diff in the generated dictionary:
and indeed in practice the order of operation are as follow: (macro.cc contains a
#include "A.h"
):A.h
and then start declaring classA
:A
, process the constructor (of anything involvingA
itself inA
declaration and callTCling::AutoParse
TCling::AutoParse
recognizesA
for the dictionary'sclassesHeaders
TCling::AutoParse
proceeed to ask for thepayloadCode
to be processed/included (with the 'patch / fix / reversal' this is replaced byA.h
), thispayloadCode
consist of:A.h
is skipped (well anyway it is actually being processed by the outer code !!)B.h
is being included is reached:which correctly complains that
A
is not yet fully declared ....The commit log corresponding to the change is explicitly referring to this change:
It is not clear why
TCling::AutoParse
is called with a symbol that is "being" declared.A work around (why we don't usually see this issue) is to generate a rootmap file (generating the c++ module should also in principle):
Full stack trace at the starting point of the failing recursive parsing:
The text was updated successfully, but these errors were encountered: