diff --git a/core/base/inc/LinkDef2.h b/core/base/inc/LinkDef2.h index bdaa1013c5f46..1626f6271c82a 100644 --- a/core/base/inc/LinkDef2.h +++ b/core/base/inc/LinkDef2.h @@ -12,8 +12,6 @@ #ifdef __CLING__ #include -#pragma link C++ class string::iterator; -#pragma link C++ class string::const_iterator; #else #include "dll_stl/str.h" #endif @@ -24,15 +22,9 @@ #pragma create TClass string; #pragma link C++ class std::vector; #pragma link C++ operator std::vector; -#pragma link C++ class std::vector::iterator; -#pragma link C++ class std::vector::const_iterator; -#pragma link C++ class std::vector::reverse_iterator; #pragma link C++ class std::vector; #pragma link C++ operators std::vector; -#pragma link C++ class std::vector::iterator; -#pragma link C++ class std::vector::const_iterator; -#pragma link C++ class std::vector::reverse_iterator; #include diff --git a/core/clingutils/res/TClingUtils.h b/core/clingutils/res/TClingUtils.h index 7968ba98fec83..0a32b6ce9bd98 100644 --- a/core/clingutils/res/TClingUtils.h +++ b/core/clingutils/res/TClingUtils.h @@ -740,6 +740,9 @@ void SetPathsForRelocatability(std::vector& clingArgs); //______________________________________________________________________________ void ReplaceAll(std::string& str, const std::string& from, const std::string& to, bool recurse=false); +//______________________________________________________________________________ +std::string GetInjectedUsingDecls(); + // Functions for the printouts ------------------------------------------------- //______________________________________________________________________________ diff --git a/core/clingutils/src/TClingUtils.cxx b/core/clingutils/src/TClingUtils.cxx index 983a02072dab6..c92c5de62c955 100644 --- a/core/clingutils/src/TClingUtils.cxx +++ b/core/clingutils/src/TClingUtils.cxx @@ -1715,13 +1715,11 @@ void ROOT::TMetaUtils::WriteClassInit(std::ostream& finalString, std::string csymbol = classname; std::string args; - if ( ! TClassEdit::IsStdClass( classname.c_str() ) ) { + csymbol = TClassEdit::InsertStd(csymbol.c_str()); - // Prefix the full class name with '::' except for the STL - // containers and std::string. This is to request the - // real class instead of the class in the namespace ROOT::Shadow - csymbol.insert(0,"::"); - } + // Prefix the full class name with '::', to refert to the + // real class instead of the class in the namespace ROOT::Shadow + csymbol.insert(0,"::"); int stl = TClassEdit::IsSTLCont(classname); bool bset = TClassEdit::IsSTLBitset(classname.c_str()); @@ -1988,7 +1986,8 @@ void ROOT::TMetaUtils::WriteClassInit(std::ostream& finalString, // FIXME Workaround: for the moment we do not generate coll proxies with unique ptrs since // they imply copies and therefore do not compile. auto classNameForIO = TClassEdit::GetNameForIO(classname); - finalString << " instance.AdoptCollectionProxyInfo(TCollectionProxyInfo::Generate(TCollectionProxyInfo::" << methodTCP << "< " << classNameForIO.c_str() << " >()));" << "\n"; + classNameForIO = TClassEdit::InsertStd(classNameForIO.c_str()); + finalString << " instance.AdoptCollectionProxyInfo(TCollectionProxyInfo::Generate(TCollectionProxyInfo::" << methodTCP << "< " << classNameForIO << " >()));" << "\n"; needCollectionProxy = true; } @@ -2378,15 +2377,12 @@ void ROOT::TMetaUtils::WriteAuxFunctions(std::ostream& finalString, // operator delete // operator delete[] - ROOT::TMetaUtils::GetCppName(mappedname,classname.c_str()); + classname = TClassEdit::InsertStd(classname.c_str()); - if ( ! TClassEdit::IsStdClass( classname.c_str() ) ) { - - // Prefix the full class name with '::' except for the STL - // containers and std::string. This is to request the - // real class instead of the class in the namespace ROOT::Shadow - classname.insert(0,"::"); - } + // Prefix the full class name with '::' except for the STL + // containers and std::string. This is to request the + // real class instead of the class in the namespace ROOT::Shadow + classname.insert(0,"::"); finalString << "namespace ROOT {" << "\n"; @@ -5102,6 +5098,49 @@ bool ROOT::TMetaUtils::IsHeaderName(const std::string &filename) llvm::sys::path::extension(filename) == "HXX"; } +//////////////////////////////////////////////////////////////////////////////// +/// Get the using decls (and corresponding `#includes`) injected into cling for +/// backward compatibility with the earlier `using namespace std`. +std::string ROOT::TMetaUtils::GetInjectedUsingDecls() { + return R"CODE(#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +using std::abs; +using std::fabs; +using std::array; +using std::bitset; +using std::cerr; +using std::cos; +using std::cout; +using std::endl; +using std::list; +using std::map; +using std::multimap; +using std::multiset; +using std::pair; +using std::round; +using std::set; +using std::sin; +using std::shared_ptr; +using std::string; +using std::tan; +using std::unique_ptr; +using std::unordered_map; +using std::unordered_set; +using std::vector; +)CODE"; +} + //////////////////////////////////////////////////////////////////////////////// const std::string ROOT::TMetaUtils::AST2SourceTools::Decls2FwdDecls(const std::vector &decls, @@ -5369,7 +5408,8 @@ int ROOT::TMetaUtils::AST2SourceTools::FwdDeclIfTmplSpec(const clang::RecordDecl } defString += argFwdDecl + '\n'; } - defString += "template <> class " + normalizedName + ';'; + std::string normalizedNameWithStd = TClassEdit::InsertStd(normalizedName.c_str()); + defString += "template <> class " + normalizedNameWithStd + ';'; return 0; } } diff --git a/core/cont/inc/LinkDef.h b/core/cont/inc/LinkDef.h index 5df7bfd611661..b6e86f1cce1cb 100644 --- a/core/cont/inc/LinkDef.h +++ b/core/cont/inc/LinkDef.h @@ -56,9 +56,6 @@ #pragma link C++ class TVirtualCollectionProxy-; #pragma link C++ class std::vector; -#pragma link C++ class std::vector::iterator; -#pragma link C++ class std::vector::const_iterator; -#pragma link C++ class std::vector::reverse_iterator; #pragma link C++ nestedclass; #pragma link C++ nestedtypedef; diff --git a/core/dictgen/src/rootcling_impl.cxx b/core/dictgen/src/rootcling_impl.cxx index f56ce23b7ac0c..646315a8a365e 100644 --- a/core/dictgen/src/rootcling_impl.cxx +++ b/core/dictgen/src/rootcling_impl.cxx @@ -859,6 +859,7 @@ int STLContainerStreamer(const clang::FieldDecl &m, if (!tmplt_specialization) return 0; string stlType(ROOT::TMetaUtils::ShortTypeName(mTypename.c_str())); + stlType = TClassEdit::InsertStd(stlType.c_str()); string stlName; stlName = ROOT::TMetaUtils::ShortTypeName(m.getName().str().c_str()); @@ -1171,6 +1172,9 @@ void WriteClassFunctions(const clang::CXXRecordDecl *cl, std::ostream &dictStrea enclSpaceNesting = ROOT::TMetaUtils::WriteNamespaceHeader(dictStream, cl); } + fullname = TClassEdit::InsertStd(fullname.c_str()); + clsname = TClassEdit::InsertStd(clsname.c_str()); + if (autoLoad) dictStream << "#include \"TInterpreter.h\"\n"; @@ -1183,22 +1187,31 @@ void WriteClassFunctions(const clang::CXXRecordDecl *cl, std::ostream &dictStrea << "//_______________________________________" << "_______________________________________" << std::endl; if (add_template_keyword) dictStream << "template <> "; - dictStream << "const char *" << clsname << "::Class_Name()" << std::endl << "{" << std::endl - << " return \"" << fullname << "\";" << std::endl << "}" << std::endl << std::endl; + dictStream << "const char *" << clsname << "::Class_Name()" << std::endl + << "{" << std::endl + << " return \"" << fullname << "\";" << std::endl + << "}" << std::endl + << std::endl; dictStream << "//_______________________________________" << "_______________________________________" << std::endl; if (add_template_keyword) dictStream << "template <> "; - dictStream << "const char *" << clsname << "::ImplFileName()" << std::endl << "{" << std::endl - << " return ::ROOT::GenerateInitInstanceLocal((const ::" << fullname - << "*)nullptr)->GetImplFileName();" << std::endl << "}" << std::endl << std::endl + dictStream << "const char *" << clsname << "::ImplFileName()" << std::endl + << "{" << std::endl + << " return ::ROOT::GenerateInitInstanceLocal((const ::" << fullname << "*)nullptr)->GetImplFileName();" + << std::endl + << "}" << std::endl + << std::endl << "//_______________________________________" << "_______________________________________" << std::endl; if (add_template_keyword) dictStream << "template <> "; - dictStream << "int " << clsname << "::ImplFileLine()" << std::endl << "{" << std::endl - << " return ::ROOT::GenerateInitInstanceLocal((const ::" << fullname - << "*)nullptr)->GetImplFileLine();" << std::endl << "}" << std::endl << std::endl + dictStream << "int " << clsname << "::ImplFileLine()" << std::endl + << "{" << std::endl + << " return ::ROOT::GenerateInitInstanceLocal((const ::" << fullname << "*)nullptr)->GetImplFileLine();" + << std::endl + << "}" << std::endl + << std::endl << "//_______________________________________" << "_______________________________________" << std::endl; @@ -1208,13 +1221,14 @@ void WriteClassFunctions(const clang::CXXRecordDecl *cl, std::ostream &dictStrea // Trigger autoloading if dictionary is split if (autoLoad) dictStream << " gInterpreter->AutoLoad(\"" << fullname << "\");\n"; - dictStream << " fgIsA = ::ROOT::GenerateInitInstanceLocal((const ::" << fullname - << "*)nullptr)->GetClass();" << std::endl - << " return fgIsA;\n" - << "}" << std::endl << std::endl + dictStream << " fgIsA = ::ROOT::GenerateInitInstanceLocal((const ::" << fullname << "*)nullptr)->GetClass();" + << std::endl + << " return fgIsA;\n" + << "}" << std::endl + << std::endl - << "//_______________________________________" - << "_______________________________________" << std::endl; + << "//_______________________________________" + << "_______________________________________" << std::endl; if (add_template_keyword) dictStream << "template <> "; dictStream << "TClass *" << clsname << "::Class()" << std::endl << "{" << std::endl; if (autoLoad) { @@ -1386,6 +1400,7 @@ void WriteStreamer(const ROOT::TMetaUtils::AnnotatedRecordDecl &cl, if (ROOT::TMetaUtils::GetNameWithinNamespace(fullname, clsname, nsname, clxx)) { enclSpaceNesting = ROOT::TMetaUtils::WriteNamespaceHeader(dictStream, cl); } + clsname = TClassEdit::InsertStd(clsname.c_str()); dictStream << "//_______________________________________" << "_______________________________________" << std::endl; @@ -1788,19 +1803,22 @@ void WriteAutoStreamer(const ROOT::TMetaUtils::AnnotatedRecordDecl &cl, if (ROOT::TMetaUtils::GetNameWithinNamespace(fullname, clsname, nsname, clxx)) { enclSpaceNesting = ROOT::TMetaUtils::WriteNamespaceHeader(dictStream, cl); } + clsname = TClassEdit::InsertStd(clsname.c_str()); dictStream << "//_______________________________________" << "_______________________________________" << std::endl; if (add_template_keyword) dictStream << "template <> "; dictStream << "void " << clsname << "::Streamer(TBuffer &R__b)" << std::endl << "{" << std::endl - << " // Stream an object of class " << fullname << "." << std::endl << std::endl + << " // Stream an object of class " << fullname << "." << std::endl + << std::endl << " if (R__b.IsReading()) {" << std::endl - << " R__b.ReadClassBuffer(" << fullname << "::Class(),this);" << std::endl + << " R__b.ReadClassBuffer(" << clsname << "::Class(),this);" << std::endl << " } else {" << std::endl - << " R__b.WriteClassBuffer(" << fullname << "::Class(),this);" << std::endl + << " R__b.WriteClassBuffer(" << clsname << "::Class(),this);" << std::endl << " }" << std::endl - << "}" << std::endl << std::endl; + << "}" << std::endl + << std::endl; while (enclSpaceNesting) { dictStream << "} // namespace " << nsname << std::endl; @@ -2821,14 +2839,15 @@ void CreateDictHeader(std::ostream &dictStream, const std::string &main_dictname << "#include \"TCollectionProxyInfo.h\"\n" << "/*******************************************************************/\n\n" << "#include \"TDataMember.h\"\n\n"; // To set their transiency + + if (main_dictname.length() > 11 && main_dictname.substr(main_dictname.length() - 11) == "_ACLiC_dict") + dictStream << ROOT::TMetaUtils::GetInjectedUsingDecls(); } //////////////////////////////////////////////////////////////////////////////// -void AddNamespaceSTDdeclaration(std::ostream &dictStream) +void AddNamespaceSTDdeclaration(std::ostream & dictStream) { - dictStream << "// The generated code does not explicitly qualify STL entities\n" - << "namespace std {} using namespace std;\n\n"; } //////////////////////////////////////////////////////////////////////////////// @@ -4436,8 +4455,24 @@ int RootClingMain(int argc, // ROOTCINT uses to define a few header implicitly, we need to do it explicitly. if (interp.declare("#include \n" "#include \"Rtypes.h\"\n" - "#include \"TObject.h\"") != cling::Interpreter::kSuccess - ) { + "#include \"TObject.h\"\n" + "#include \n" + "#include \n" + "#include \n" + "#include \n" + "#include \n" + "#include \n" + "#include \n" + "#include \n" + "#include \n" + "#include \n" + "#include \n" + "using std::allocator; using std::bitset; using std::default_delete; using " + "std::forward_list; using std::list; using std::map; using std::multimap; using " + "std::multiset; using std::pair; using std::set; using std::shared_ptr; using std::string; " + "using std::unique_ptr; using std::unordered_multimap; using std::unordered_map; using " + "std::unordered_multiset; using std::unordered_set; using std::vector;") != + cling::Interpreter::kSuccess) { // There was an error. ROOT::TMetaUtils::Error(nullptr, "Error loading the default rootcling header files.\n"); return 1; @@ -4446,7 +4481,7 @@ int RootClingMain(int argc, if (interp.declare("#include \n" // For the list of 'opaque' typedef to also include string. "#include \n" // For initializing TNormalizedCtxt. - "namespace std {} using namespace std;") != cling::Interpreter::kSuccess) { + ) != cling::Interpreter::kSuccess) { ROOT::TMetaUtils::Error(nullptr, "Error loading the default header files.\n"); return 1; } @@ -4635,8 +4670,6 @@ int RootClingMain(int argc, } std::ostream &dictStream = (!gOptIgnoreExistingDict && !gOptDictionaryFileName.empty()) ? fileout : std::cout; - bool isACLiC = gOptDictionaryFileName.getValue().find("_ACLiC_dict") != std::string::npos; - if (!gOptIgnoreExistingDict) { // Now generate a second stream for the split dictionary if it is necessary if (gOptSplit) { @@ -4657,16 +4690,6 @@ int RootClingMain(int argc, CreateDictHeader(dictStream, main_dictname); if (gOptSplit) CreateDictHeader(*splitDictStream, main_dictname); - - if (!gOptNoGlobalUsingStd) { - // ACLiC'ed macros might rely on `using namespace std` in front of user headers - if (isACLiC) { - AddNamespaceSTDdeclaration(dictStream); - if (gOptSplit) { - AddNamespaceSTDdeclaration(*splitDictStream); - } - } - } } //--------------------------------------------------------------------------- @@ -4884,15 +4907,6 @@ int RootClingMain(int argc, GenerateNecessaryIncludes(*splitDictStream, includeForSource, extraIncludes); } } - if (!gOptNoGlobalUsingStd) { - // ACLiC'ed macros might have relied on `using namespace std` in front of user headers - if (!isACLiC) { - AddNamespaceSTDdeclaration(dictStream); - if (gOptSplit) { - AddNamespaceSTDdeclaration(*splitDictStream); - } - } - } if (gDriverConfig->fInitializeStreamerInfoROOTFile) { gDriverConfig->fInitializeStreamerInfoROOTFile(modGen.GetModuleFileName().c_str()); } @@ -4906,13 +4920,6 @@ int RootClingMain(int argc, constructorTypes.emplace_back("", interp); } } - if (!gOptIgnoreExistingDict && gOptNoGlobalUsingStd) { - AddNamespaceSTDdeclaration(dictStream); - - if (gOptSplit && splitDictStream) { - AddNamespaceSTDdeclaration(*splitDictStream); - } - } if (gOptGeneratePCH) { AnnotateAllDeclsForPCH(interp, scan); diff --git a/core/foundation/src/RConversionRuleParser.cxx b/core/foundation/src/RConversionRuleParser.cxx index 59fead341afd2..c0121006e56ff 100644 --- a/core/foundation/src/RConversionRuleParser.cxx +++ b/core/foundation/src/RConversionRuleParser.cxx @@ -475,10 +475,11 @@ namespace ROOT static void WriteAutoVariables( const std::list& target, const SourceTypeList_t& source, - MembersTypeMap_t& members, - std::string& className, std::string& mappedName, + const MembersTypeMap_t& members, + std::string className, const std::string& mappedName, std::ostream& output ) { + className = TClassEdit::InsertStd(className.c_str()); if (!source.empty()) { Bool_t start = true; SourceTypeList_t::const_iterator it; @@ -616,18 +617,20 @@ namespace ROOT std::list::const_iterator it; for( it = target.begin(); it != target.end(); ++it ) { - Internal::TSchemaType memData = members[*it]; + const Internal::TSchemaType &memData = members.find(*it)->second; output << " static Long_t offset_" << *it << " = "; output << "cls->GetDataMemberOffset(\"" << *it << "\");"; output << std::endl; + std::string memDataType = TClassEdit::InsertStd(memData.fType.c_str()); if (memData.fDimensions.size()) { - output << " typedef " << memData.fType << " " << *it << "_t" << memData.fDimensions << ";" << std::endl; + output << " typedef " << memDataType << " " << *it << "_t" << memData.fDimensions << ";" + << std::endl; output << " " << *it << "_t& " << *it << " = "; output << "*(" << *it << "_t *)(target+offset_" << *it; output << ");" << std::endl; } else { - output << " " << memData.fType << "& " << *it << " = "; - output << "*(" << memData.fType << "*)(target+offset_" << *it; + output << " " << memDataType << "& " << *it << " = "; + output << "*(" << memDataType << "*)(target+offset_" << *it; output << ");" << std::endl; } } diff --git a/core/foundation/src/TClassEdit.cxx b/core/foundation/src/TClassEdit.cxx index 2c648bdd6a4d2..73ba8090dc4e7 100644 --- a/core/foundation/src/TClassEdit.cxx +++ b/core/foundation/src/TClassEdit.cxx @@ -1744,14 +1744,13 @@ static void ResolveTypedefImpl(const char *tname, //////////////////////////////////////////////////////////////////////////////// +/// Return the name of type 'tname' with all its typedef components replaced +/// by the actual type its points to +/// For example for `typedef MyObj MyObjTypedef;` +/// `vector` return `vector` string TClassEdit::ResolveTypedef(const char *tname, bool /* resolveAll */) { - // Return the name of type 'tname' with all its typedef components replaced - // by the actual type its points to - // For example for "typedef MyObj MyObjTypedef;" - // vector return vector - // if (!tname || *tname == 0) return ""; @@ -1780,17 +1779,15 @@ string TClassEdit::ResolveTypedef(const char *tname, bool /* resolveAll */) //////////////////////////////////////////////////////////////////////////////// +/// Return the name of type 'tname' with all STL classes prepended by "std::". +/// For example for `vector > >` return +/// std::vector > >` string TClassEdit::InsertStd(const char *tname) { - // Return the name of type 'tname' with all STL classes prepended by "std::". - // For example for "vector > >" it returns - // "std::vector > >" - // - - static const char* sSTLtypes[] = { + static const char *sSTLtypes[] = { "allocator", - "auto_ptr", + "any", "bad_alloc", "bad_cast", "bad_exception", @@ -1821,7 +1818,9 @@ string TClassEdit::InsertStd(const char *tname) "complex", "ctype_byname", "ctype", + "default_delete", "deque", + "discard_block_engine", "divides", "domain_error", "equal_to", @@ -1856,6 +1855,7 @@ string TClassEdit::InsertStd(const char *tname) "mask_array", "mem_fun", "mem_fun_ref", + "mersenne_twister_engine", "messages", "messages_byname", "minus", @@ -1890,19 +1890,23 @@ string TClassEdit::InsertStd(const char *tname) "reverse_iterator", "runtime_error", "set", + "shared_ptr", "slice_array", "slice", "stack", "string", "strstream", "strstreambuf", + "subtract_with_carry_engine", + "thread", "time_get_byname", "time_get", "time_put_byname", "time_put", + "tuple", "unary_function", "unary_negate", - "unique_pointer", + "unique_ptr", "underflow_error", "unordered_map", "unordered_multimap", @@ -1910,6 +1914,7 @@ string TClassEdit::InsertStd(const char *tname) "unordered_set", "valarray", "vector", + "weak_ptr", "wstring" }; @@ -1963,7 +1968,7 @@ string TClassEdit::InsertStd(const char *tname) } //////////////////////////////////////////////////////////////////////////////// -/// An helper class to dismount the name and remount it changed whenever +/// A helper class to dismount the name and remount it changed whenever /// necessary class NameCleanerForIO { diff --git a/core/meta/inc/TDictionary.h b/core/meta/inc/TDictionary.h index 04546c4ac37d4..e77f8e02ffd76 100644 --- a/core/meta/inc/TDictionary.h +++ b/core/meta/inc/TDictionary.h @@ -193,6 +193,9 @@ class TDictionary : public TNamed { static TDictionary* GetDictionary(const char* name); static TDictionary* GetDictionary(const std::type_info &typeinfo); + /// Return `true` if the TClass representd a name in the `std::` namespace. + Bool_t IsInStdLib() const { return Property() & kIsDefinedInStd; } + // Type of STL container (returned by IsSTLContainer). enum ESTLType { kNone = ROOT::kNotSTL, diff --git a/core/metacling/src/TCling.cxx b/core/metacling/src/TCling.cxx index 707934b68ae5a..85f0316bb3ab1 100644 --- a/core/metacling/src/TCling.cxx +++ b/core/metacling/src/TCling.cxx @@ -1330,7 +1330,8 @@ static void RegisterPreIncludedHeaders(cling::Interpreter &clingInterp) #ifndef R__WIN32 PreIncludes += "#include \n"; #endif - PreIncludes += "using namespace std;\n"; + PreIncludes += ROOT::TMetaUtils::GetInjectedUsingDecls(); + clingInterp.declare(PreIncludes); } @@ -2659,16 +2660,11 @@ void TCling::InspectMembers(TMemberInspector& insp, const void* obj, return; } - static const TClassRef clRefString("std::string"); - if (clRefString == cl) { - // We stream std::string without going through members.. + if (cl->IsInStdLib() && strncmp(cl->GetName(), "unique_ptr<", 11) != 0) + // We stream std::string and friends without going through members. + // `CloseStreamerInfoROOTFile()` needs to know the internal structure + // of std::unique_ptr. return; - } - - if (TClassEdit::IsStdArray(cl->GetName())) { - // We treat std arrays as C arrays - return; - } const char* cobj = (const char*) obj; // for ptr arithmetics diff --git a/geom/geom/inc/LinkDef1.h b/geom/geom/inc/LinkDef1.h index fd6918f9176e9..642b443b10ed6 100644 --- a/geom/geom/inc/LinkDef1.h +++ b/geom/geom/inc/LinkDef1.h @@ -100,9 +100,4 @@ #pragma link C++ class TGeoNavigator+; #pragma link C++ class TGeoNavigatorArray; #pragma link C++ class TGDMLMatrix+; -#pragma link C++ struct std::map; -#pragma link C++ struct std::pair; -#pragma link C++ struct std::map; -#pragma link C++ struct std::pair; - #endif diff --git a/graf3d/eve/inc/LinkDef1.h b/graf3d/eve/inc/LinkDef1.h index ad6d66b622afc..d0057516c1501 100644 --- a/graf3d/eve/inc/LinkDef1.h +++ b/graf3d/eve/inc/LinkDef1.h @@ -105,7 +105,6 @@ // TEveChunkManager #pragma link C++ class TEveChunkManager+; -#pragma link C++ class TEveChunkManager::iterator-; // TEveEventManager #pragma link C++ class TEveEventManager+; @@ -123,15 +122,11 @@ #pragma link C++ class TEveElementEditor+; #pragma link C++ class std::list; -#pragma link C++ class std::list::iterator; -#pragma link C++ class std::list::const_iterator; #pragma link C++ typedef TEveElement::List_t; #pragma link C++ typedef TEveElement::List_i; #pragma link C++ typedef TEveElement::List_ci; #pragma link C++ class std::set; -#pragma link C++ class std::set::iterator; -#pragma link C++ class std::set::const_iterator; #pragma link C++ typedef TEveElement::Set_t; #pragma link C++ typedef TEveElement::Set_i; #pragma link C++ typedef TEveElement::Set_ci; @@ -192,8 +187,6 @@ #pragma link C++ class TEveProjection+; #pragma link C++ class TEveProjection::PreScaleEntry_t+; #pragma link C++ class std::vector; -#pragma link C++ class std::vector::iterator; -#pragma link C++ operators std::vector::iterator; #pragma link C++ typedef TEveProjection::vPreScale_t; #pragma link C++ typedef TEveProjection::vPreScale_i; #pragma link C++ class TEveRhoZProjection+; diff --git a/graf3d/eve/src/TEveChunkManager.cxx b/graf3d/eve/src/TEveChunkManager.cxx index 08304c3ba2131..86a37e81afd33 100644 --- a/graf3d/eve/src/TEveChunkManager.cxx +++ b/graf3d/eve/src/TEveChunkManager.cxx @@ -22,7 +22,6 @@ The structure can be Refit() to occupy a single contiguous array. */ ClassImp(TEveChunkManager); -ClassImp(TEveChunkManager::iterator); //////////////////////////////////////////////////////////////////////////////// /// Release all memory chunks. diff --git a/graf3d/eve7/inc/LinkDef.h b/graf3d/eve7/inc/LinkDef.h index c0945f778ad39..e2523e4486860 100644 --- a/graf3d/eve7/inc/LinkDef.h +++ b/graf3d/eve7/inc/LinkDef.h @@ -242,7 +242,6 @@ // REveChunkManager #pragma link C++ class ROOT::Experimental::REveChunkManager+; -#pragma link C++ class ROOT::Experimental::REveChunkManager::iterator; // Tables #pragma link C++ class ROOT::Experimental::REveTableViewInfo; diff --git a/io/rootpcm/src/rootclingIO.cxx b/io/rootpcm/src/rootclingIO.cxx index 9e470646f4089..58c6855139763 100644 --- a/io/rootpcm/src/rootclingIO.cxx +++ b/io/rootpcm/src/rootclingIO.cxx @@ -16,6 +16,7 @@ #include "TEnum.h" #include "TError.h" #include "TFile.h" +#include "TInterpreter.h" #include "TProtoClass.h" #include "TDataMember.h" #include "TROOT.h" @@ -151,7 +152,14 @@ bool CloseStreamerInfoROOTFile(bool writeEmptyRootPCM) for (const auto & normName : gClassesToStore) { TClass *cl = TClass::GetClass(normName.c_str(), kTRUE /*load*/); if (!cl) { - Error("CloseStreamerInfoROOTFile", "Cannot find class %s.", normName.c_str()); + static int uniqueIndex = 0; + const std::string checkStdNames_Code = "void RootCling_CheckStdNames_" + std::to_string(++uniqueIndex) + + "() { using namespace std; using type = " + normName.c_str() + ";}"; + if (gInterpreter->Declare(checkStdNames_Code.c_str())) + Error("CloseStreamerInfoROOTFile", + "ROOT I/O on class %s is unsupported due to missing stdlib type support.", normName.c_str()); + else + Error("CloseStreamerInfoROOTFile", "Cannot find class %s.", normName.c_str()); return false; } diff --git a/math/fumili/inc/LinkDef.h b/math/fumili/inc/LinkDef.h index 31378af3fbd08..ed733bc422439 100644 --- a/math/fumili/inc/LinkDef.h +++ b/math/fumili/inc/LinkDef.h @@ -17,6 +17,4 @@ #pragma link C++ global gFumili; #pragma link C++ class TFumili; -#pragma link C++ class TFumiliMinimizer; - #endif diff --git a/math/fumili/inc/TFumiliMinimizer.h b/math/fumili/inc/TFumiliMinimizer.h index 20640c4e24f90..b48dc72c991a5 100644 --- a/math/fumili/inc/TFumiliMinimizer.h +++ b/math/fumili/inc/TFumiliMinimizer.h @@ -173,9 +173,6 @@ class TFumiliMinimizer : public ROOT::Math::Minimizer { static ROOT::Math::FitMethodGradFunction * fgGradFunc; static TFumili * fgFumili; // static instance (used by fcn function) - - ClassDef(TFumiliMinimizer,1) //Implementation of Minimizer interface using TFumili - }; diff --git a/math/fumili/src/TFumiliMinimizer.cxx b/math/fumili/src/TFumiliMinimizer.cxx index 087cdffbf09c5..8cd114499e27c 100644 --- a/math/fumili/src/TFumiliMinimizer.cxx +++ b/math/fumili/src/TFumiliMinimizer.cxx @@ -130,10 +130,6 @@ ROOT::Math::FitMethodFunction * TFumiliMinimizer::fgFunc = 0; ROOT::Math::FitMethodGradFunction * TFumiliMinimizer::fgGradFunc = 0; TFumili * TFumiliMinimizer::fgFumili = 0; - -ClassImp(TFumiliMinimizer); - - TFumiliMinimizer::TFumiliMinimizer(int ) : fDim(0), fNFree(0), diff --git a/math/mathcore/inc/LinkDef2.h b/math/mathcore/inc/LinkDef2.h index 4ac1d929c146b..7882bfd16b524 100644 --- a/math/mathcore/inc/LinkDef2.h +++ b/math/mathcore/inc/LinkDef2.h @@ -22,10 +22,6 @@ //#pragma link C++ class ROOT::Math; #endif -#pragma link C++ class std::vector::iterator; -#pragma link C++ class std::vector::const_iterator; -#pragma link C++ class std::vector::reverse_iterator; - #pragma link C++ global gRandom; #pragma link C++ class TRandom+; diff --git a/proof/xrdinc/XrdClient/XrdClientInputBuffer.hh b/proof/xrdinc/XrdClient/XrdClientInputBuffer.hh index 971fe2eba2620..84c8316f53781 100644 --- a/proof/xrdinc/XrdClient/XrdClientInputBuffer.hh +++ b/proof/xrdinc/XrdClient/XrdClientInputBuffer.hh @@ -45,8 +45,6 @@ #include "XrdOuc/XrdOucHash.hh" #include "XrdClient/XrdClientVector.hh" -using namespace std; - class XrdClientInputBuffer { private: diff --git a/roofit/roofit/inc/LinkDef1.h b/roofit/roofit/inc/LinkDef1.h index 67ea67810b8f1..88499e0942040 100644 --- a/roofit/roofit/inc/LinkDef1.h +++ b/roofit/roofit/inc/LinkDef1.h @@ -55,7 +55,6 @@ #pragma link C++ class RooStepFunction+ ; #pragma link C++ class RooMultiBinomial+ ; /* #pragma link C++ class std::vector< TVector2 >; */ -/* #pragma link C++ class std::vector< TVector2 >::iterator ; */ /* #pragma link C++ class RooPolyMorph2D+ ; */ // #pragma link C++ class RooUniform+ ; diff --git a/test/TBench.h b/test/TBench.h index d7f232053532a..17288b1d0d908 100644 --- a/test/TBench.h +++ b/test/TBench.h @@ -9,7 +9,6 @@ namespace stdext {} #include #include -#ifndef WIN32 using std::vector; using std::list; using std::deque; @@ -17,10 +16,6 @@ using std::set; using std::multiset; using std::map; using std::multimap; -#else -using namespace std; -using namespace stdext; -#endif //------------------------------------------------------------- class THit {