Skip to content

Commit 24f3ca1

Browse files
committed
[meta] Test spurrious auto parsing when looking up a TClass
reproduces root-project/root#17992
1 parent 13d3f75 commit 24f3ca1

File tree

5 files changed

+53
-0
lines changed

5 files changed

+53
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
ROOTTEST_GENERATE_DICTIONARY(libDataObject dataObject.hxx
2+
LINKDEF LinkDef.h
3+
NO_CXXMODULE
4+
FIXTURES_SETUP avoidParsingLibrary)
5+
6+
ROOTTEST_ADD_TEST(avoidParsingSpace
7+
MACRO runAvoidParsing.C
8+
MACROARG true
9+
OUTREF avoidParsing.ref
10+
FIXTURES_REQUIRED avoidParsingLibrary)
11+
12+
ROOTTEST_ADD_TEST(avoidParsingNoSpace
13+
MACRO runAvoidParsing.C
14+
MACROARG false
15+
OUTREF avoidParsing.ref
16+
FIXTURES_REQUIRED avoidParsingLibrary)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#pragma link C++ class testing::InnerContent+;
2+
#pragma link C++ class testing::UserClass<testing::FindUsingAdvance<testing::InnerContent>>+;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#pragma once
2+
3+
#ifdef TEST_RUNTIME
4+
#error "This header should not be loaded at runtime"
5+
#endif
6+
7+
#include <vector>
8+
9+
namespace testing
10+
{
11+
struct InnerContent {};
12+
template <typename T>
13+
struct FindUsingAdvance {};
14+
15+
using Collection = std::vector<int>;
16+
17+
template <typename T>
18+
class UserClass
19+
{
20+
public:
21+
int fValue;
22+
Collection fCollValue;
23+
};
24+
}
25+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#define TEST_RUNTIME 1
2+
3+
void runAvoidParsing(bool space = true)
4+
{
5+
if(space)
6+
TClass::GetClass("testing::UserClass<testing::FindUsingAdvance<testing::InnerContent> >");
7+
else
8+
TClass::GetClass("testing::UserClass<testing::FindUsingAdvance<testing::InnerContent>>");
9+
}

0 commit comments

Comments
 (0)