From 568ae3aaae0a19c3973e3f1e5260138c66bf4704 Mon Sep 17 00:00:00 2001 From: Axel Naumann Date: Fri, 5 Mar 2021 18:38:23 +0100 Subject: [PATCH] Add test for CMS fwd decl enumerator as template arg: See https://github.com/cms-sw/cmsdist/pull/6690#issuecomment-788782759 Tests https://github.com/root-project/root/issues/7390 --- .../dict/fwd-decl-enumconstant/CMakeLists.txt | 10 ++++++++ cling/dict/fwd-decl-enumconstant/Hash.h | 12 ++++++++++ .../dict/fwd-decl-enumconstant/HashedTypes.h | 18 ++++++++++++++ .../fwd-decl-enumconstant/ParameterSetID.h | 24 +++++++++++++++++++ cling/dict/fwd-decl-enumconstant/classes.h | 1 + .../execfwdDeclEnumconstant.C | 3 +++ .../dict/fwd-decl-enumconstant/selection.xml | 3 +++ 7 files changed, 71 insertions(+) create mode 100644 cling/dict/fwd-decl-enumconstant/CMakeLists.txt create mode 100644 cling/dict/fwd-decl-enumconstant/Hash.h create mode 100644 cling/dict/fwd-decl-enumconstant/HashedTypes.h create mode 100644 cling/dict/fwd-decl-enumconstant/ParameterSetID.h create mode 100644 cling/dict/fwd-decl-enumconstant/classes.h create mode 100644 cling/dict/fwd-decl-enumconstant/execfwdDeclEnumconstant.C create mode 100644 cling/dict/fwd-decl-enumconstant/selection.xml diff --git a/cling/dict/fwd-decl-enumconstant/CMakeLists.txt b/cling/dict/fwd-decl-enumconstant/CMakeLists.txt new file mode 100644 index 0000000000..1a7aceaf75 --- /dev/null +++ b/cling/dict/fwd-decl-enumconstant/CMakeLists.txt @@ -0,0 +1,10 @@ +ROOTTEST_GENERATE_REFLEX_DICTIONARY(fwdDeclEnumconstantDict + OPTIONS --fail_on_warnings + SELECTION selection.xml + classes.h + ) + +ROOTTEST_ADD_TEST(fwdDeclEnumconstant + MACRO execfwdDeclEnumconstant.C + DEPENDS fwdDeclEnumconstantDict-libgen-build + LABELS roottest regression cling) diff --git a/cling/dict/fwd-decl-enumconstant/Hash.h b/cling/dict/fwd-decl-enumconstant/Hash.h new file mode 100644 index 0000000000..828fe26f67 --- /dev/null +++ b/cling/dict/fwd-decl-enumconstant/Hash.h @@ -0,0 +1,12 @@ +#ifndef DataFormats_Provenance_Hash_h +#define DataFormats_Provenance_Hash_h + +namespace edm { + + template + class Hash { + public: + }; + +} // namespace edm +#endif diff --git a/cling/dict/fwd-decl-enumconstant/HashedTypes.h b/cling/dict/fwd-decl-enumconstant/HashedTypes.h new file mode 100644 index 0000000000..d85e024f70 --- /dev/null +++ b/cling/dict/fwd-decl-enumconstant/HashedTypes.h @@ -0,0 +1,18 @@ +#ifndef DataFormats_Provenance_HashedTypes_h +#define DataFormats_Provenance_HashedTypes_h + +/// Declaration of the enum HashedTypes, used in defining several "id" +/// classes. + +namespace edm { + enum HashedTypes { + ModuleDescriptionType, // Obsolete + ParameterSetType, + ProcessHistoryType, + ProcessConfigurationType, + EntryDescriptionType, // Obsolete + ParentageType + }; +} + +#endif // DataFormats_Provenance_HashedTypes_h diff --git a/cling/dict/fwd-decl-enumconstant/ParameterSetID.h b/cling/dict/fwd-decl-enumconstant/ParameterSetID.h new file mode 100644 index 0000000000..c8a85bee08 --- /dev/null +++ b/cling/dict/fwd-decl-enumconstant/ParameterSetID.h @@ -0,0 +1,24 @@ +#ifndef DataFormats_Provenance_ParameterSetID_h +#define DataFormats_Provenance_ParameterSetID_h + +/*---------------------------------------------------------------------- + +ParameterSetID: A globally unique identifier for each collection of +tracked parameters. Two ParameterSet objects will have equal +ParameterSetIDs if they contain the same set of tracked parameters. + +We calculate the ParameterSetID from the names and values of the +tracked parameters within a ParameterSet, currently using the MD5 +algorithm. + + +----------------------------------------------------------------------*/ + +#include "Hash.h" +#include "HashedTypes.h" + +namespace edm { + typedef Hash ParameterSetID; + +} +#endif diff --git a/cling/dict/fwd-decl-enumconstant/classes.h b/cling/dict/fwd-decl-enumconstant/classes.h new file mode 100644 index 0000000000..9ee6f7f7aa --- /dev/null +++ b/cling/dict/fwd-decl-enumconstant/classes.h @@ -0,0 +1 @@ +#include "ParameterSetID.h" diff --git a/cling/dict/fwd-decl-enumconstant/execfwdDeclEnumconstant.C b/cling/dict/fwd-decl-enumconstant/execfwdDeclEnumconstant.C new file mode 100644 index 0000000000..ee59a30e47 --- /dev/null +++ b/cling/dict/fwd-decl-enumconstant/execfwdDeclEnumconstant.C @@ -0,0 +1,3 @@ +int execfwdDeclEnumconstant() { + return gSystem->Load("libfwdDeclEnumconstantDict_dictrflx"); +} diff --git a/cling/dict/fwd-decl-enumconstant/selection.xml b/cling/dict/fwd-decl-enumconstant/selection.xml new file mode 100644 index 0000000000..4cafbaa1fe --- /dev/null +++ b/cling/dict/fwd-decl-enumconstant/selection.xml @@ -0,0 +1,3 @@ + + +