Add test of the case where the definition are indirectly included
This commit is contained in:
parent
1bd0822562
commit
d066ad6061
@ -41,12 +41,23 @@ template <typename T> class WithDefaultAndFwd;
|
||||
// the forward declaration in fwd_Def2.h). See ROOT-8443.
|
||||
template <typename T> class TemplateWithUserForward;
|
||||
|
||||
#include "Def2sub.h"
|
||||
#include "Def2.h"
|
||||
|
||||
DefaultInFwd<> dif;
|
||||
WithDefaultAndFwd<> wdaf;
|
||||
TemplateWithUserForward<> twuf;
|
||||
|
||||
// In some implementation the AutoloadingVisitor was not when Def2sub.h, which
|
||||
// contains the definition for CtorWithDefault, and then the implementation
|
||||
// was also looping over all element of the decl chain without skipping definition,
|
||||
// resulting in a loss of the default parameter values for the method/functions of
|
||||
// CtorWithDefault when AutoloadingVisitor was called upon because of the inclusion
|
||||
// Def2.h
|
||||
CtorWithDefault c;
|
||||
M::N::A mna;
|
||||
M::N::D mnd;
|
||||
|
||||
.T Enum.h fwd_enums.h
|
||||
#include "fwd_enums.h"
|
||||
#include "Enum.h"
|
||||
|
@ -16,6 +16,7 @@ template <typename T> class DefaultInFwd {};
|
||||
template <typename T = int> class WithDefaultAndFwd {};
|
||||
template <typename T = int> class TemplateWithUserForward{};
|
||||
|
||||
#include "Def2sub.h"
|
||||
|
||||
namespace M {
|
||||
namespace N {
|
||||
@ -23,10 +24,18 @@ namespace M {
|
||||
T function(T t) {
|
||||
return t;
|
||||
}
|
||||
class A{};
|
||||
class A {
|
||||
public:
|
||||
A(int i = 0) {};
|
||||
};
|
||||
template<typename T>class B : public A {};
|
||||
class C :public B<int> {};
|
||||
|
||||
class D {
|
||||
public:
|
||||
D(int i = 0) {};
|
||||
};
|
||||
|
||||
}
|
||||
void FunctionWithDefaultArg(int x=0) {
|
||||
}
|
||||
|
18
test/Autoloading/Def2sub.h
Normal file
18
test/Autoloading/Def2sub.h
Normal file
@ -0,0 +1,18 @@
|
||||
#ifndef Def2sub_h
|
||||
#define Def2sub_h
|
||||
|
||||
class CtorWithDefault {
|
||||
public:
|
||||
CtorWithDefault(int i = 0) {};
|
||||
};
|
||||
|
||||
// Supporting the default paramter here, requires an
|
||||
// extension of the information stored with the annotation
|
||||
// so that the cleanup is triggered upon any inclusion of
|
||||
// of Def2sub.h rather than only the one coming from Def2.h
|
||||
template <typename T> // = int>
|
||||
class TemplateWithAllDefault
|
||||
{
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user