ROOT  6.06/09
Reference Guide
TMetaUtils.h
Go to the documentation of this file.
1 // @(#)root/metautils:$Id$
2 // Author: Axel Naumann, Nov 2011
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2011, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TMetaUtils
13 #define ROOT_TMetaUtils
14 
15 #include "RConversionRuleParser.h"
16 
17 #include <set>
18 #include <string>
19 #include <unordered_set>
20 
21 //#include <atomic>
22 #include <stdlib.h>
23 
24 namespace llvm {
25  class StringRef;
26 }
27 
28 namespace clang {
29  class ASTContext;
30  class Attr;
31  class ClassTemplateDecl;
32  class ClassTemplateSpecializationDecl;
33  class CompilerInstance;
34  class CXXBaseSpecifier;
35  class CXXRecordDecl;
36  class Decl;
37  class DeclContext;
38  class DeclaratorDecl;
39  class FieldDecl;
40  class FunctionDecl;
41  class Module;
42  class NamedDecl;
43  class ParmVarDecl;
44  class PresumedLoc;
45  class QualType;
46  class RecordDecl;
47  class SourceLocation;
48  class TagDecl;
49  class TemplateDecl;
50  class TemplateName;
51  class TemplateArgument;
52  class TemplateArgumentList;
53  class TemplateParameterList;
54  class Type;
55  class TypeDecl;
56  class TypedefNameDecl;
57  struct PrintingPolicy;
58 }
59 
60 namespace cling {
61  class Interpreter;
62  class LookupHelper;
63  namespace utils {
64  namespace Transform {
65  struct Config;
66  }
67  }
68 }
69 
70 // For ROOT::ESTLType
71 #include "ESTLType.h"
72 
73 // for TClassEdit::TInterpreterLookupHelper
74 #include "TClassEdit.h"
75 
76 #ifndef ROOT_Varargs
77 #include "Varargs.h"
78 #endif
79 
80 namespace ROOT {
81  namespace TMetaUtils {
82 
83 // Forward Declarations --------------------------------------------------------
84 class AnnotatedRecordDecl;
85 
86 // Constants, typedefs and Enums -----------------------------------------------
87 
88 // Convention for the ROOT relevant properties
89 namespace propNames{
90  static const std::string separator("@@@");
91  static const std::string iotype("iotype");
92  static const std::string name("name");
93  static const std::string pattern("pattern");
94  static const std::string ioname("ioname");
95  static const std::string comment("comment");
96  static const std::string nArgsToKeep("nArgsToKeep");
97  static const std::string persistent("persistent");
98  static const std::string transient("transient");
99 }
100 
101 extern int gErrorIgnoreLevel;
102 
103 // Get the array index information for a data member.
105 
107  const cling::Interpreter &interp,
108  const TNormalizedCtxt &normCtxt,
109  std::ostream& dictStream,
110  bool isAutoStreamer);
111 
112 const int kInfo = 0;
113 const int kNote = 500;
114 const int kThrowOnWarning = 999;
115 const int kWarning = 1000;
116 const int kError = 2000;
117 const int kSysError = 3000;
118 const int kFatal = 4000;
119 const int kMaxLen = 1024;
120 
121 // Classes ---------------------------------------------------------------------
122 class TNormalizedCtxtImpl;
123 
124 //______________________________________________________________________________
126 private:
127  TNormalizedCtxtImpl* fImpl;
128 public:
129  using Config_t = cling::utils::Transform::Config;
130  using TypesCont_t = std::set<const clang::Type*>;
131  using TemplPtrIntMap_t = std::map<const clang::ClassTemplateDecl*, int>;
132 
133  TNormalizedCtxt(const cling::LookupHelper &lh);
134  TNormalizedCtxt(const TNormalizedCtxt& other);
136  const Config_t& GetConfig() const;
137  const TypesCont_t &GetTypeWithAlternative() const;
138 
139  void AddTemplAndNargsToKeep(const clang::ClassTemplateDecl* templ, unsigned int i);
140  int GetNargsToKeep(const clang::ClassTemplateDecl* templ) const;
142  void keepTypedef(const cling::LookupHelper &lh, const char* name,
143  bool replace = false);
144 };
145 
146 //______________________________________________________________________________
148 public:
149  typedef bool (*ExistingTypeCheck_t)(const std::string &tname, std::string &result);
150  typedef bool (*AutoParse_t)(const char *name);
151 
152 private:
153  cling::Interpreter *fInterpreter;
157  const int *fPDebug; // debug flag, might change at runtime thus *
158  bool WantDiags() const { return fPDebug && *fPDebug > 5; }
159 
160 public:
161  TClingLookupHelper(cling::Interpreter &interpreter, TNormalizedCtxt &normCtxt,
162  ExistingTypeCheck_t existingTypeCheck,
163  AutoParse_t autoParse,
164  const int *pgDebug = 0);
165  virtual ~TClingLookupHelper() { /* we're not owner */ }
166 
167  virtual bool ExistingTypeCheck(const std::string &tname, std::string &result);
168  virtual void GetPartiallyDesugaredName(std::string &nameLong);
169  virtual bool IsAlreadyPartiallyDesugaredName(const std::string &nondef, const std::string &nameLong);
170  virtual bool IsDeclaredScope(const std::string &base, bool &isInlined);
171  virtual bool GetPartiallyDesugaredNameWithScopeHandling(const std::string &tname, std::string &result);
172 };
173 
174 //______________________________________________________________________________
176 private:
178  const clang::RecordDecl* fDecl;
179  std::string fRequestedName;
180  std::string fNormalizedName;
186 
187 public:
188  enum ERootFlag {
189  kNoStreamer = 0x01,
193  kHasVersion = 0x08
194  };
195 
196  AnnotatedRecordDecl(long index,
197  const clang::RecordDecl *decl,
198  bool rStreamerInfo,
199  bool rNoStreamer,
200  bool rRequestNoInputOperator,
201  bool rRequestOnlyTClass,
202  int rRequestedVersionNumber,
203  const cling::Interpreter &interpret,
204  const TNormalizedCtxt &normCtxt);
205 
206  AnnotatedRecordDecl(long index,
207  const clang::RecordDecl *decl,
208  const char *requestName,
209  bool rStreamerInfo,
210  bool rNoStreamer,
211  bool rRequestNoInputOperator,
212  bool rRequestOnlyTClass,
213  int rRequestedVersionNumber,
214  const cling::Interpreter &interpret,
215  const TNormalizedCtxt &normCtxt);
216 
217  AnnotatedRecordDecl(long index,
218  const clang::Type *requestedType,
219  const clang::RecordDecl *decl,
220  const char *requestedName,
221  bool rStreamerInfo,
222  bool rNoStreamer,
223  bool rRequestNoInputOperator,
224  bool rRequestOnlyTClass,
225  int rRequestedVersionNumber,
226  const cling::Interpreter &interpret,
227  const TNormalizedCtxt &normCtxt);
228 
229  AnnotatedRecordDecl(long index,
230  const clang::Type *requestedType,
231  const clang::RecordDecl *decl,
232  const char *requestedName,
233  unsigned int nTemplateArgsToSkip,
234  bool rStreamerInfo,
235  bool rNoStreamer,
236  bool rRequestNoInputOperator,
237  bool rRequestOnlyTClass,
238  int rRequestedVersionNumber,
239  const cling::Interpreter &interpret,
240  const TNormalizedCtxt &normCtxt);
241 
243  // Nothing to do we do not own the pointer;
244  }
245 
246 
247  long GetRuleIndex() const { return fRuleIndex; }
248 
249  const char *GetRequestedName() const { return fRequestedName.c_str(); }
250  const char *GetNormalizedName() const { return fNormalizedName.c_str(); }
251  bool HasClassVersion() const { return fRequestedVersionNumber >=0 ; }
252  bool RequestStreamerInfo() const {
253  // Equivalent to CINT's cl.RootFlag() & G__USEBYTECOUNT
254  return fRequestStreamerInfo;
255  }
257  bool RequestNoStreamer() const { return fRequestNoStreamer; }
258  bool RequestOnlyTClass() const { return fRequestOnlyTClass; }
260  int RootFlag() const {
261  // Return the request (streamerInfo, has_version, etc.) combined in a single
262  // int. See RScanner::AnnotatedRecordDecl::ERootFlag.
263  int result = 0;
264  if (fRequestNoStreamer) result = kNoStreamer;
265  if (fRequestNoInputOperator) result |= kNoInputOperator;
266  if (fRequestStreamerInfo) result |= kStreamerInfo;
267  if (fRequestedVersionNumber > -1) result |= kHasVersion;
268  return result;
269  }
270  const clang::RecordDecl* GetRecordDecl() const { return fDecl; }
271 
272  operator clang::RecordDecl const *() const {
273  return fDecl;
274  }
275 
276  bool operator<(const AnnotatedRecordDecl& right) const
277  {
278  return fRuleIndex < right.fRuleIndex;
279  }
280 
281  struct CompareByName {
282  bool operator() (const AnnotatedRecordDecl& right, const AnnotatedRecordDecl& left)
283  {
284  return left.fNormalizedName < right.fNormalizedName;
285  }
286  };
287 };
288 
289 //______________________________________________________________________________
291 private:
292  const std::string fArgTypeName;
293  const clang::CXXRecordDecl *fArgType;
294 
295 public:
296  RConstructorType(const char *type_of_arg, const cling::Interpreter&);
297 
298  const char *GetName() const ;
299  const clang::CXXRecordDecl *GetType() const;
300 };
301 typedef std::list<RConstructorType> RConstructorTypes;
302 
303 // Functions -------------------------------------------------------------------
304 
305 //_____________________________________________________________________________
306 unsigned int GetNumberOfWarningsAndErrors();
307 
308 //______________________________________________________________________________
309 int extractAttrString(clang::Attr* attribute, std::string& attrString);
310 
311 //______________________________________________________________________________
312 int extractPropertyNameValFromString(const std::string attributeStr,std::string& attrName, std::string& attrValue);
313 
314 //______________________________________________________________________________
315 int extractPropertyNameVal(clang::Attr* attribute, std::string& attrName, std::string& attrValue);
316 
317 //______________________________________________________________________________
318 bool ExtractAttrPropertyFromName(const clang::Decl& decl,
319  const std::string& propName,
320  std::string& propValue);
321 
322 //______________________________________________________________________________
323 bool ExtractAttrIntPropertyFromName(const clang::Decl& decl,
324  const std::string& propName,
325  int& propValue);
326 
327 //______________________________________________________________________________
328 bool RequireCompleteType(const cling::Interpreter &interp, const clang::CXXRecordDecl *cl);
329 
330 //______________________________________________________________________________
331 bool RequireCompleteType(const cling::Interpreter &interp, clang::SourceLocation Loc, clang::QualType Type);
332 
333 //______________________________________________________________________________
334 // Add default template parameters.
335 clang::QualType AddDefaultParameters(clang::QualType instanceType,
336  const cling::Interpreter &interpret,
337  const TNormalizedCtxt &normCtxt);
338 
339 //______________________________________________________________________________
340 llvm::StringRef DataMemberInfo__ValidArrayIndex(const clang::DeclaratorDecl &m, int *errnum = 0, llvm::StringRef *errstr = 0);
341 
342 //______________________________________________________________________________
343 // Return the ROOT include directory
344 std::string GetROOTIncludeDir(bool rootbuild);
345 
347 
348 //______________________________________________________________________________
349 EIOCtorCategory CheckConstructor(const clang::CXXRecordDecl*, const RConstructorType&, const cling::Interpreter& interp);
350 
351 //______________________________________________________________________________
352 const clang::FunctionDecl* ClassInfo__HasMethod(const clang::DeclContext *cl, char const*, const cling::Interpreter& interp);
353 
354 //______________________________________________________________________________
355 void CreateNameTypeMap(clang::CXXRecordDecl const&, std::map<std::string, ROOT::Internal::TSchemaType, std::less<std::string>, std::allocator<std::pair<std::string const, ROOT::Internal::TSchemaType> > >&);
356 
357 //______________________________________________________________________________
358 int ElementStreamer(std::ostream& finalString,
359  const clang::NamedDecl &forcontext,
360  const clang::QualType &qti,
361  const char *t,
362  int rwmode,
363  const cling::Interpreter &interp,
364  const char *tcl=0);
365 
366 //______________________________________________________________________________
367 bool IsBase(const clang::CXXRecordDecl *cl, const clang::CXXRecordDecl *base, const clang::CXXRecordDecl *context,const cling::Interpreter &interp);
368 
369 //______________________________________________________________________________
370 bool IsBase(const clang::FieldDecl &m, const char* basename, const cling::Interpreter &interp);
371 
372 //______________________________________________________________________________
373 bool HasCustomOperatorNewArrayPlacement(clang::RecordDecl const&, const cling::Interpreter &interp);
374 
375 //______________________________________________________________________________
376 bool HasCustomOperatorNewPlacement(char const*, clang::RecordDecl const&, const cling::Interpreter&);
377 
378 //______________________________________________________________________________
379 bool HasCustomOperatorNewPlacement(clang::RecordDecl const&, const cling::Interpreter&);
380 
381 //______________________________________________________________________________
382 bool HasDirectoryAutoAdd(clang::CXXRecordDecl const*, const cling::Interpreter&);
383 
384 //______________________________________________________________________________
385 bool HasIOConstructor(clang::CXXRecordDecl const*, std::string&, const RConstructorTypes&, const cling::Interpreter&);
386 
387 //______________________________________________________________________________
388 bool HasNewMerge(clang::CXXRecordDecl const*, const cling::Interpreter&);
389 
390 //______________________________________________________________________________
391 bool HasOldMerge(clang::CXXRecordDecl const*, const cling::Interpreter&);
392 
393 //______________________________________________________________________________
394 bool hasOpaqueTypedef(clang::QualType instanceType, const TNormalizedCtxt &normCtxt);
395 
396 //______________________________________________________________________________
397 bool hasOpaqueTypedef(const AnnotatedRecordDecl &cl, const cling::Interpreter &interp, const TNormalizedCtxt &normCtxt);
398 
399 //______________________________________________________________________________
400 bool HasResetAfterMerge(clang::CXXRecordDecl const*, const cling::Interpreter&);
401 
402 //______________________________________________________________________________
403 bool NeedDestructor(clang::CXXRecordDecl const*);
404 
405 //______________________________________________________________________________
406 bool NeedTemplateKeyword(clang::CXXRecordDecl const*);
407 
408 //______________________________________________________________________________
409 bool CheckPublicFuncWithProto(clang::CXXRecordDecl const*, char const*, char const*,
410  const cling::Interpreter&, bool diagnose);
411 
412 //______________________________________________________________________________
413 long GetLineNumber(clang::Decl const*);
414 
415 //______________________________________________________________________________
416 bool GetNameWithinNamespace(std::string&, std::string&, std::string&, clang::CXXRecordDecl const*);
417 
418 //______________________________________________________________________________
419 void GetQualifiedName(std::string &qual_name, const clang::QualType &type, const clang::NamedDecl &forcontext);
420 
421 //----
422 std::string GetQualifiedName(const clang::QualType &type, const clang::NamedDecl &forcontext);
423 
424 //______________________________________________________________________________
425 void GetQualifiedName(std::string &qual_name, const clang::Type &type, const clang::NamedDecl &forcontext);
426 
427 //----
428 std::string GetQualifiedName(const clang::Type &type, const clang::NamedDecl &forcontext);
429 
430 //______________________________________________________________________________
431 void GetQualifiedName(std::string &qual_name, const clang::NamedDecl &nd);
432 
433 //----
434 std::string GetQualifiedName(const clang::NamedDecl &nd);
435 
436 //______________________________________________________________________________
437 void GetQualifiedName(std::string &qual_name, const AnnotatedRecordDecl &annotated);
438 
439 //----
440 std::string GetQualifiedName(const AnnotatedRecordDecl &annotated);
441 
442 //______________________________________________________________________________
443 void GetQualifiedName(std::string &qual_name, const clang::RecordDecl &recordDecl);
444 
445 //----
446 std::string GetQualifiedName(const clang::RecordDecl &recordDecl);
447 
448 //______________________________________________________________________________
449 int WriteNamespaceHeader(std::ostream&, const clang::RecordDecl *);
450 
451 //______________________________________________________________________________
452 int WriteNamespaceHeader(std::ostream&, const clang::DeclContext *);
453 
454 //______________________________________________________________________________
455 void WritePointersSTL(const AnnotatedRecordDecl &cl, const cling::Interpreter &interp, const TNormalizedCtxt &normCtxt);
456 
457 //______________________________________________________________________________
458 int GetClassVersion(const clang::RecordDecl *cl, const cling::Interpreter &interp);
459 
460 //______________________________________________________________________________
461 int IsSTLContainer(const AnnotatedRecordDecl &annotated);
462 
463 //______________________________________________________________________________
464 ROOT::ESTLType IsSTLContainer(const clang::FieldDecl &m);
465 
466 //______________________________________________________________________________
467 int IsSTLContainer(const clang::CXXBaseSpecifier &base);
468 
469 //______________________________________________________________________________
470 const char *ShortTypeName(const char *typeDesc);
471 
472 //______________________________________________________________________________
473 std::string ShortTypeName(const clang::FieldDecl &m);
474 
475 //______________________________________________________________________________
476 bool IsStreamableObject(const clang::FieldDecl &m, const cling::Interpreter& interp);
477 
478 //______________________________________________________________________________
479 clang::RecordDecl *GetUnderlyingRecordDecl(clang::QualType type);
480 
481 //______________________________________________________________________________
482 std::string TrueName(const clang::FieldDecl &m);
483 
484 //______________________________________________________________________________
485 const clang::CXXRecordDecl *ScopeSearch(const char *name,
486  const cling::Interpreter &gInterp,
487  bool diagnose,
488  const clang::Type** resultType);
489 
490 //______________________________________________________________________________
491 void WriteAuxFunctions(std::ostream& finalString,
492  const AnnotatedRecordDecl &cl,
493  const clang::CXXRecordDecl *decl,
494  const cling::Interpreter &interp,
495  const RConstructorTypes& ctorTypes,
496  const TNormalizedCtxt &normCtxt);
497 
498 
499 //______________________________________________________________________________
500 const clang::FunctionDecl *GetFuncWithProto(const clang::Decl* cinfo,
501  const char *method,
502  const char *proto,
503  const cling::Interpreter &gInterp,
504  bool diagnose);
505 
506 //______________________________________________________________________________
507 void WriteClassCode(CallWriteStreamer_t WriteStreamerFunc,
508  const AnnotatedRecordDecl &cl,
509  const cling::Interpreter &interp,
510  const TNormalizedCtxt &normCtxt,
511  std::ostream& finalString,
512  const RConstructorTypes& ctorTypes,
513  bool isGenreflex);
514 
515 //______________________________________________________________________________
516 void WriteClassInit(std::ostream& finalString,
517  const AnnotatedRecordDecl &cl,
518  const clang::CXXRecordDecl *decl,
519  const cling::Interpreter &interp,
520  const TNormalizedCtxt &normCtxt,
521  const RConstructorTypes& ctorTypes,
522  bool& needCollectionProxy);
523 
524 //______________________________________________________________________________
525 bool HasCustomStreamerMemberFunction(const AnnotatedRecordDecl &cl,
526  const clang::CXXRecordDecl* clxx,
527  const cling::Interpreter &interp,
528  const TNormalizedCtxt &normCtxt);
529 
530 //______________________________________________________________________________
531 bool HasCustomConvStreamerMemberFunction(const AnnotatedRecordDecl &cl,
532  const clang::CXXRecordDecl* clxx,
533  const cling::Interpreter &interp,
534  const TNormalizedCtxt &normCtxt);
535 
536 //______________________________________________________________________________
537 // Return the header file to be included to declare the Decl
538 llvm::StringRef GetFileName(const clang::Decl& decl,
539  const cling::Interpreter& interp);
540 
541 //______________________________________________________________________________
542 // Return the dictionary file name for a module
543 std::string GetModuleFileName(const char* moduleName);
544 
545 //______________________________________________________________________________
546 // Declare a virtual module.map to clang. Returns Module on success.
547 clang::Module* declareModuleMap(clang::CompilerInstance* CI,
548  const char* moduleFileName,
549  const char* headers[]);
550 
551 //______________________________________________________________________________
552 // Return the -I needed to find RuntimeUniverse.h
553 std::string GetInterpreterExtraIncludePath(bool rootbuild);
554 
555 //______________________________________________________________________________
556 // Return the LLVM / clang resource directory
557 std::string GetLLVMResourceDir(bool rootbuild);
558 
559 //______________________________________________________________________________
560 // Return the ROOT include directory
561 std::string GetROOTIncludeDir(bool rootbuild);
562 
563 //______________________________________________________________________________
564 // Return (in the argument 'output') a mangled version of the C++ symbol/type (pass as 'input')
565 // that can be used in C++ as a variable name.
566 void GetCppName(std::string &output, const char *input);
567 
568 //______________________________________________________________________________
569 // Return the type with all parts fully qualified (most typedefs),
570 // including template arguments, appended to name.
571 void GetFullyQualifiedTypeName(std::string &name, const clang::QualType &type, const cling::Interpreter &interpreter);
572 
573 //______________________________________________________________________________
574 // Return the type with all parts fully qualified (most typedefs),
575 // including template arguments, appended to name, without using the interpreter
576 void GetFullyQualifiedTypeName(std::string &name, const clang::QualType &type, const clang::ASTContext &);
577 
578 //______________________________________________________________________________
579 // Return the type normalized for ROOT,
580 // keeping only the ROOT opaque typedef (Double32_t, etc.) and
581 // adding default template argument for all types except those explicitly
582 // requested to be drop by the user.
583 // Default template for STL collections are not yet removed by this routine.
584 clang::QualType GetNormalizedType(const clang::QualType &type, const cling::Interpreter &interpreter, const TNormalizedCtxt &normCtxt);
585 
586 //______________________________________________________________________________
587 // Return the type name normalized for ROOT,
588 // keeping only the ROOT opaque typedef (Double32_t, etc.) and
589 // adding default template argument for all types except the STL collections
590 // where we remove the default template argument if any.
591 void GetNormalizedName(std::string &norm_name, const clang::QualType &type, const cling::Interpreter &interpreter, const TNormalizedCtxt &normCtxt);
592 
593 //______________________________________________________________________________
594 // Alternative signature
595 void GetNormalizedName(std::string &norm_name,
596  const clang::TypeDecl* typeDecl,
597  const cling::Interpreter &interpreter);
598 
599 //______________________________________________________________________________
600 // Returns comment in a meaningful way
601 llvm::StringRef GetComment(const clang::Decl &decl, clang::SourceLocation *loc = 0);
602 
603 //______________________________________________________________________________
604 // Returns the comment of the ClassDef macro
605 llvm::StringRef GetClassComment(const clang::CXXRecordDecl &decl, clang::SourceLocation *loc, const cling::Interpreter &interpreter);
606 
607 //______________________________________________________________________________
608 // Return the base/underlying type of a chain of array or pointers type.
609 const clang::Type *GetUnderlyingType(clang::QualType type);
610 
611 //______________________________________________________________________________
612 // Scans the redeclaration chain for an annotation.
613 //
614 // returns 0 if no annotation was found.
615 //
616 template<typename T>
617 const T* GetAnnotatedRedeclarable(const T* Redecl) {
618  if (!Redecl)
619  return 0;
620 
621  Redecl = Redecl->getMostRecentDecl();
622  while (Redecl && !Redecl->hasAttrs())
623  Redecl = Redecl->getPreviousDecl();
624 
625  return Redecl;
626 }
627 
628 //______________________________________________________________________________
629 // Overload the template for typedefs, because they don't contain
630 // isThisDeclarationADefinition method. (Use inline to avoid violating ODR)
631 const clang::TypedefNameDecl* GetAnnotatedRedeclarable(const clang::TypedefNameDecl* TND);
632 
633 //______________________________________________________________________________
634 // Overload the template for tags, because we only check definitions.
635 const clang::TagDecl* GetAnnotatedRedeclarable(const clang::TagDecl* TND);
636 
637 //______________________________________________________________________________
638 // Return true if the decl is part of the std namespace.
639 bool IsStdClass(const clang::RecordDecl &cl);
640 
641 //______________________________________________________________________________
642 // Return true, if the decl is part of the std namespace and we want
643 // its default parameter dropped.
644 bool IsStdDropDefaultClass(const clang::RecordDecl &cl);
645 
646 //______________________________________________________________________________
647 // See if the CXXRecordDecl matches the current of any of the previous CXXRecordDecls
648 bool MatchWithDeclOrAnyOfPrevious(const clang::CXXRecordDecl &cl, const clang::CXXRecordDecl &currentCl);
649 
650 //______________________________________________________________________________
651 // Return true if the decl is of type
652 bool IsOfType(const clang::CXXRecordDecl &cl, const std::string& type, const cling::LookupHelper& lh);
653 
654 //______________________________________________________________________________
655 // Return which kind of STL container the decl is, if any.
656 ROOT::ESTLType IsSTLCont(const clang::RecordDecl &cl);
657 
658 //______________________________________________________________________________
659 // Check if 'input' or any of its template parameter was substituted when
660 // instantiating the class template instance and replace it with the
661 // partially sugared type we have from 'instance'.
662 clang::QualType ReSubstTemplateArg(clang::QualType input, const clang::Type *instance);
663 
664 //______________________________________________________________________________
665 // Remove the last n template arguments from the name
666 int RemoveTemplateArgsFromName(std::string& name, unsigned int);
667 
668 //______________________________________________________________________________
669 clang::TemplateName ExtractTemplateNameFromQualType(const clang::QualType& qt);
670 
671 //______________________________________________________________________________
672 bool QualType2Template(const clang::QualType& qt,
673  clang::ClassTemplateDecl*& ctd,
674  clang::ClassTemplateSpecializationDecl*& ctsd);
675 
676 //______________________________________________________________________________
677 clang::ClassTemplateDecl* QualType2ClassTemplateDecl(const clang::QualType& qt);
678 
679 //______________________________________________________________________________
680 // Extract the namespaces enclosing a DeclContext
681 void ExtractCtxtEnclosingNameSpaces(const clang::DeclContext&,
682  std::list<std::pair<std::string,bool> >&);
683 //______________________________________________________________________________
684 void ExtractEnclosingNameSpaces(const clang::Decl&,
685  std::list<std::pair<std::string,bool> >&);
686 
687 //______________________________________________________________________________
688 const clang::RecordDecl* ExtractEnclosingScopes(const clang::Decl& decl,
689  std::list<std::pair<std::string,unsigned int> >& enclosingSc);
690 //______________________________________________________________________________
691 // Kind of stl container
692 ROOT::ESTLType STLKind(const llvm::StringRef type);
693 
694 //______________________________________________________________________________
695 // Set the toolchain and the include paths for relocatability
696 void SetPathsForRelocatability(std::vector<std::string>& clingArgs);
697 
698 //______________________________________________________________________________
699 void ReplaceAll(std::string& str, const std::string& from, const std::string& to, bool recurse=false);
700 
701 // Functions for the printouts -------------------------------------------------
702 
703 //______________________________________________________________________________
704 void LevelPrint(bool prefix, int level, const char *location, const char *fmt, va_list ap);
705 
706 //______________________________________________________________________________
707 void Error(const char *location, const char *va_(fmt), ...);
708 
709 //______________________________________________________________________________
710 void SysError(const char *location, const char *va_(fmt), ...);
711 
712 //______________________________________________________________________________
713 void Info(const char *location, const char *va_(fmt), ...);
714 
715 //______________________________________________________________________________
716 void Warning(const char *location, const char *va_(fmt), ...);
717 
718 //______________________________________________________________________________
719 void Fatal(const char *location, const char *va_(fmt), ...);
720 
721 //______________________________________________________________________________
722 const std::string& GetPathSeparator();
723 
724 //______________________________________________________________________________
725 bool EndsWith(const std::string &theString, const std::string &theSubstring);
726 
727 //______________________________________________________________________________
728 bool BeginsWith(const std::string &theString, const std::string &theSubstring);
729 
730 //______________________________________________________________________________
731 namespace AST2SourceTools {
732 
733 //______________________________________________________________________________
734 const std::string Decls2FwdDecls(const std::vector<const clang::Decl*> &decls,
735  bool (*ignoreFiles)(const clang::PresumedLoc&) ,
736  const cling::Interpreter& interp);
737 
738 //______________________________________________________________________________
739 int PrepareArgsForFwdDecl(std::string& templateArgs,
740  const clang::TemplateParameterList& tmplParamList,
741  const cling::Interpreter& interpreter);
742 
743 //______________________________________________________________________________
744 int EncloseInNamespaces(const clang::Decl& decl, std::string& defString);
745 
746 //______________________________________________________________________________
747 const clang::RecordDecl* EncloseInScopes(const clang::Decl& decl, std::string& defString);
748 
749 //______________________________________________________________________________
750 int FwdDeclFromRcdDecl(const clang::RecordDecl& recordDecl,
751  const cling::Interpreter& interpreter,
752  std::string& defString,
753  bool acceptStl=false);
754 
755 //______________________________________________________________________________
756 int FwdDeclFromTmplDecl(const clang::TemplateDecl& tmplDecl,
757  const cling::Interpreter& interpreter,
758  std::string& defString);
759 //______________________________________________________________________________
760 int GetDefArg(const clang::ParmVarDecl& par, std::string& valAsString, const clang::PrintingPolicy& pp);
761 
762 //______________________________________________________________________________
763 int FwdDeclFromFcnDecl(const clang::FunctionDecl& fcnDecl,
764  const cling::Interpreter& interpreter,
765  std::string& defString);
766 //______________________________________________________________________________
767 int FwdDeclFromTypeDefNameDecl(const clang::TypedefNameDecl& tdnDecl,
768  const cling::Interpreter& interpreter,
769  std::string& fwdDeclString,
770  std::unordered_set<std::string>* fwdDeclSet=nullptr);
771 
772 } // namespace AST2SourceTools
773 
774 } // namespace TMetaUtils
775 
776 } // namespace ROOT
777 
778 #endif // ROOT_TMetaUtils
bool(* AutoParse_t)(const char *name)
Definition: TMetaUtils.h:150
bool NeedTemplateKeyword(clang::CXXRecordDecl const *)
void CreateNameTypeMap(clang::CXXRecordDecl const &, std::map< std::string, ROOT::Internal::TSchemaType, std::less< std::string >, std::allocator< std::pair< std::string const, ROOT::Internal::TSchemaType > > > &)
const clang::RecordDecl * ExtractEnclosingScopes(const clang::Decl &decl, std::list< std::pair< std::string, unsigned int > > &enclosingSc)
Extract the names and types of containing scopes.
double par[1]
Definition: unuranDistr.cxx:38
int extractPropertyNameValFromString(const std::string attributeStr, std::string &attrName, std::string &attrValue)
static const std::string nArgsToKeep("nArgsToKeep")
int GetClassVersion(const clang::RecordDecl *cl, const cling::Interpreter &interp)
Return the version number of the class or -1 if the function Class_Version does not exist...
ESTLType
Definition: ESTLType.h:28
bool IsStreamableObject(const clang::FieldDecl &m, const cling::Interpreter &interp)
int GetDefArg(const clang::ParmVarDecl &par, std::string &valAsString, const clang::PrintingPolicy &pp)
Get the default value as string.
void AddTemplAndNargsToKeep(const clang::ClassTemplateDecl *templ, unsigned int i)
Definition: TMetaUtils.cxx:341
Definition: TString.h:780
llvm::StringRef GetFileName(const clang::Decl &decl, const cling::Interpreter &interp)
Return the header file to be included to declare the Decl.
Namespace for new ROOT classes and functions.
Definition: ROOT.py:1
cling::Interpreter * gInterp
cling::Interpreter * fInterpreter
Definition: TMetaUtils.h:153
long GetLineNumber(clang::Decl const *)
It looks like the template specialization decl actually contains less information on the location of ...
bool CheckPublicFuncWithProto(clang::CXXRecordDecl const *, char const *, char const *, const cling::Interpreter &, bool diagnose)
Return true, if the function (defined by the name and prototype) exists and is public.
static const std::string comment("comment")
const char * ShortTypeName(const char *typeDesc)
Return the absolute type of typeDesc.
void Error(const char *location, const char *va_(fmt),...)
Use this function in case an error occured.
double T(double x)
Definition: ChebyshevPol.h:34
std::map< const clang::ClassTemplateDecl *, int > TemplPtrIntMap_t
Definition: TMetaUtils.h:131
clang::RecordDecl * GetUnderlyingRecordDecl(clang::QualType type)
std::string GetLLVMResourceDir(bool rootbuild)
Return the LLVM / clang resource directory.
clang::QualType ReSubstTemplateArg(clang::QualType input, const clang::Type *instance)
Check if 'input' or any of its template parameter was substituted when instantiating the class templa...
llvm::StringRef DataMemberInfo__ValidArrayIndex(const clang::DeclaratorDecl &m, int *errnum=0, llvm::StringRef *errstr=0)
ValidArrayIndex return a static string (so use it or copy it immediatly, do not call GrabIndex twice ...
static const std::string iotype("iotype")
TNormalizedCtxt(const cling::LookupHelper &lh)
Definition: TMetaUtils.cxx:324
void GetFullyQualifiedTypeName(std::string &name, const clang::QualType &type, const cling::Interpreter &interpreter)
void GetCppName(std::string &output, const char *input)
Return (in the argument 'output') a mangled version of the C++ symbol/type (pass as 'input') that can...
unsigned int GetNumberOfWarningsAndErrors()
Definition: TMetaUtils.cxx:67
bool operator()(const AnnotatedRecordDecl &right, const AnnotatedRecordDecl &left)
Definition: TMetaUtils.h:282
void GetQualifiedName(std::string &qual_name, const clang::QualType &type, const clang::NamedDecl &forcontext)
Main implementation relying on GetFullyQualifiedTypeName All other GetQualifiedName functions leverag...
int GetNargsToKeep(const clang::ClassTemplateDecl *templ) const
Definition: TMetaUtils.cxx:345
bool ExtractAttrPropertyFromName(const clang::Decl &decl, const std::string &propName, std::string &propValue)
This routine counts on the "propNamepropValue" format.
int RemoveTemplateArgsFromName(std::string &name, unsigned int)
Remove the last n template arguments from the name.
DataMemberInfo__ValidArrayIndex_error_code
Definition: TMetaUtils.h:104
TClingLookupHelper(cling::Interpreter &interpreter, TNormalizedCtxt &normCtxt, ExistingTypeCheck_t existingTypeCheck, AutoParse_t autoParse, const int *pgDebug=0)
Definition: TMetaUtils.cxx:469
int extractAttrString(clang::Attr *attribute, std::string &attrString)
Extract attr string.
ExistingTypeCheck_t fExistingTypeCheck
Definition: TMetaUtils.h:155
bool HasDirectoryAutoAdd(clang::CXXRecordDecl const *, const cling::Interpreter &)
Return true if the class has a method DirectoryAutoAdd(TDirectory *)
const TypesCont_t & GetTypeWithAlternative() const
Definition: TMetaUtils.cxx:338
bool hasOpaqueTypedef(clang::QualType instanceType, const TNormalizedCtxt &normCtxt)
Return true if the type is a Double32_t or Float16_t or is a instance template that depends on Double...
const clang::Type * GetUnderlyingType(clang::QualType type)
Return the base/underlying type of a chain of array or pointers type.
virtual bool ExistingTypeCheck(const std::string &tname, std::string &result)
Helper routine to ry hard to avoid looking up in the Cling database as this could enduce an unwanted ...
Definition: TMetaUtils.cxx:484
const Config_t & GetConfig() const
Definition: TMetaUtils.cxx:335
bool HasCustomConvStreamerMemberFunction(const AnnotatedRecordDecl &cl, const clang::CXXRecordDecl *clxx, const cling::Interpreter &interp, const TNormalizedCtxt &normCtxt)
Return true if the class has a custom member function streamer.
bool(* ExistingTypeCheck_t)(const std::string &tname, std::string &result)
Definition: TMetaUtils.h:149
static const std::string separator("@@@")
bool MatchWithDeclOrAnyOfPrevious(const clang::CXXRecordDecl &cl, const clang::CXXRecordDecl &currentCl)
This is a recursive function.
int FwdDeclFromTypeDefNameDecl(const clang::TypedefNameDecl &tdnDecl, const cling::Interpreter &interpreter, std::string &fwdDeclString, std::unordered_set< std::string > *fwdDeclSet=nullptr)
Extract "forward declaration" of a typedef.
virtual void GetPartiallyDesugaredName(std::string &nameLong)
Definition: TMetaUtils.cxx:495
bool BeginsWith(const std::string &theString, const std::string &theSubstring)
bool IsStdDropDefaultClass(const clang::RecordDecl &cl)
Return true, if the decl is part of the std namespace and we want its default parameter dropped...
int FwdDeclFromRcdDecl(const clang::RecordDecl &recordDecl, const cling::Interpreter &interpreter, std::string &defString, bool acceptStl=false)
Convert a rcd decl to its fwd decl If this is a template specialisation, treat in the proper way...
const TemplPtrIntMap_t GetTemplNargsToKeepMap() const
Definition: TMetaUtils.cxx:349
static const std::string pattern("pattern")
#define va_(arg)
Definition: Varargs.h:41
bool HasNewMerge(clang::CXXRecordDecl const *, const cling::Interpreter &)
Return true if the class has a method Merge(TCollection*,TFileMergeInfo*)
bool IsStdClass(const clang::RecordDecl &cl)
Return true, if the decl is part of the std namespace.
std::string GetModuleFileName(const char *moduleName)
Return the dictionary file name for a module.
std::string GetInterpreterExtraIncludePath(bool rootbuild)
Return the -I needed to find RuntimeUniverse.h.
int EncloseInNamespaces(const clang::Decl &decl, std::string &defString)
Take the namespaces which enclose the decl and put them around the definition string.
void WriteClassInit(std::ostream &finalString, const AnnotatedRecordDecl &cl, const clang::CXXRecordDecl *decl, const cling::Interpreter &interp, const TNormalizedCtxt &normCtxt, const RConstructorTypes &ctorTypes, bool &needCollectionProxy)
FIXME: a function of ~300 lines!
void WritePointersSTL(const AnnotatedRecordDecl &cl, const cling::Interpreter &interp, const TNormalizedCtxt &normCtxt)
Write interface function for STL members.
void Info(const char *location, const char *va_(fmt),...)
Use this function for informational messages.
void WriteAuxFunctions(std::ostream &finalString, const AnnotatedRecordDecl &cl, const clang::CXXRecordDecl *decl, const cling::Interpreter &interp, const RConstructorTypes &ctorTypes, const TNormalizedCtxt &normCtxt)
std::string NormalizedName; GetNormalizedName(NormalizedName, decl->getASTContext().getTypeDeclType(decl), interp, normCtxt);
int WriteNamespaceHeader(std::ostream &, const clang::RecordDecl *)
int extractPropertyNameVal(clang::Attr *attribute, std::string &attrName, std::string &attrValue)
const clang::FunctionDecl * GetFuncWithProto(const clang::Decl *cinfo, const char *method, const char *proto, const cling::Interpreter &gInterp, bool diagnose)
bool HasOldMerge(clang::CXXRecordDecl const *, const cling::Interpreter &)
Return true if the class has a method Merge(TCollection*)
const clang::RecordDecl * GetRecordDecl() const
Definition: TMetaUtils.h:270
void(* CallWriteStreamer_t)(const AnnotatedRecordDecl &cl, const cling::Interpreter &interp, const TNormalizedCtxt &normCtxt, std::ostream &dictStream, bool isAutoStreamer)
Definition: TMetaUtils.h:106
void GetNormalizedName(std::string &norm_name, const clang::QualType &type, const cling::Interpreter &interpreter, const TNormalizedCtxt &normCtxt)
Return the type name normalized for ROOT, keeping only the ROOT opaque typedef (Double32_t, etc.) and adding default template argument for all types except the STL collections where we remove the default template argument if any.
int FwdDeclFromTmplDecl(const clang::TemplateDecl &tmplDecl, const cling::Interpreter &interpreter, std::string &defString)
Convert a tmplt decl to its fwd decl.
virtual bool IsAlreadyPartiallyDesugaredName(const std::string &nondef, const std::string &nameLong)
Definition: TMetaUtils.cxx:511
bool ExtractAttrIntPropertyFromName(const clang::Decl &decl, const std::string &propName, int &propValue)
This routine counts on the "propNamepropValue" format.
std::list< RConstructorType > RConstructorTypes
Definition: TMetaUtils.h:301
const std::string & GetPathSeparator()
Return the separator suitable for this platform.
int PrepareArgsForFwdDecl(std::string &templateArgs, const clang::TemplateParameterList &tmplParamList, const cling::Interpreter &interpreter)
Loop over the template parameters and build a string for template arguments using the fully qualified...
std::string TrueName(const clang::FieldDecl &m)
TrueName strips the typedefs and array dimensions.
const clang::RecordDecl * EncloseInScopes(const clang::Decl &decl, std::string &defString)
Take the scopes which enclose the decl and put them around the definition string. ...
bool HasCustomStreamerMemberFunction(const AnnotatedRecordDecl &cl, const clang::CXXRecordDecl *clxx, const cling::Interpreter &interp, const TNormalizedCtxt &normCtxt)
Return true if the class has a custom member function streamer.
ROOT::ESTLType STLKind(const llvm::StringRef type)
Converts STL container name to number. vector -> 1, etc..
const clang::CXXRecordDecl * ScopeSearch(const char *name, const cling::Interpreter &gInterp, bool diagnose, const clang::Type **resultType)
Return the scope corresponding to 'name' or std::'name'.
Definition: TMetaUtils.cxx:710
const T * GetAnnotatedRedeclarable(const T *Redecl)
Definition: TMetaUtils.h:617
const clang::CXXRecordDecl * GetType() const
bool RequireCompleteType(const cling::Interpreter &interp, const clang::CXXRecordDecl *cl)
Definition: TMetaUtils.cxx:733
TMarker * m
Definition: textangle.C:8
ROOT::ESTLType IsSTLCont(const clang::RecordDecl &cl)
type : type name: vector,allocator> result: 0 : not stl container abs(result):...
const clang::FunctionDecl * ClassInfo__HasMethod(const clang::DeclContext *cl, char const *, const cling::Interpreter &interp)
Definition: TMetaUtils.cxx:696
std::set< const clang::Type * > TypesCont_t
Definition: TMetaUtils.h:130
static const std::string name("name")
void SetPathsForRelocatability(std::vector< std::string > &clingArgs)
Organise the parameters for cling in order to guarantee relocatability It treats the gcc toolchain an...
bool operator<(const AnnotatedRecordDecl &right) const
Definition: TMetaUtils.h:276
Type
enumeration specifying the integration types.
bool NeedDestructor(clang::CXXRecordDecl const *)
RConstructorType(const char *type_of_arg, const cling::Interpreter &)
const clang::RecordDecl * fDecl
Definition: TMetaUtils.h:178
void ExtractCtxtEnclosingNameSpaces(const clang::DeclContext &, std::list< std::pair< std::string, bool > > &)
Extract enclosing namespaces recusrively.
Definition: TCling.h:48
static const std::string persistent("persistent")
EIOCtorCategory CheckConstructor(const clang::CXXRecordDecl *, const RConstructorType &, const cling::Interpreter &interp)
Definition: TMetaUtils.cxx:973
int type
Definition: TGX11.cxx:120
Definition: TDatime.h:114
virtual bool GetPartiallyDesugaredNameWithScopeHandling(const std::string &tname, std::string &result)
We assume that we have a simple type: [const] typename[*&][const].
Definition: TMetaUtils.cxx:546
const std::string Decls2FwdDecls(const std::vector< const clang::Decl * > &decls, bool(*ignoreFiles)(const clang::PresumedLoc &), const cling::Interpreter &interp)
llvm::StringRef GetClassComment(const clang::CXXRecordDecl &decl, clang::SourceLocation *loc, const cling::Interpreter &interpreter)
Return the class comment after the ClassDef: class MyClass { ...
int FwdDeclFromFcnDecl(const clang::FunctionDecl &fcnDecl, const cling::Interpreter &interpreter, std::string &defString)
void Warning(const char *location, const char *va_(fmt),...)
Use this function in warning situations.
bool GetNameWithinNamespace(std::string &, std::string &, std::string &, clang::CXXRecordDecl const *)
Return true if one of the class' enclosing scope is a namespace and set fullname to the fully qualifi...
void SysError(const char *location, const char *va_(fmt),...)
Use this function in case a system (OS or GUI) related error occured.
bool EndsWith(const std::string &theString, const std::string &theSubstring)
const char * GetNormalizedName() const
Definition: TMetaUtils.h:250
const char * GetRequestedName() const
Definition: TMetaUtils.h:249
virtual bool IsDeclaredScope(const std::string &base, bool &isInlined)
Definition: TMetaUtils.cxx:527
cling::utils::Transform::Config Config_t
Definition: TMetaUtils.h:129
int ElementStreamer(std::ostream &finalString, const clang::NamedDecl &forcontext, const clang::QualType &qti, const char *t, int rwmode, const cling::Interpreter &interp, const char *tcl=0)
Definition: TMetaUtils.cxx:795
void LevelPrint(bool prefix, int level, const char *location, const char *fmt, va_list ap)
typedef void((*Func_t)())
llvm::StringRef GetComment(const clang::Decl &decl, clang::SourceLocation *loc=0)
Returns the comment (// striped away), annotating declaration in a meaningful for ROOT IO way...
bool IsBase(const clang::CXXRecordDecl *cl, const clang::CXXRecordDecl *base, const clang::CXXRecordDecl *context, const cling::Interpreter &interp)
Definition: TMetaUtils.cxx:752
clang::Module * declareModuleMap(clang::CompilerInstance *CI, const char *moduleFileName, const char *headers[])
Declare a virtual module.map to clang. Returns Module on success.
void ReplaceAll(std::string &str, const std::string &from, const std::string &to, bool recurse=false)
std::string GetROOTIncludeDir(bool rootbuild)
int IsSTLContainer(const AnnotatedRecordDecl &annotated)
Is this an STL container.
void keepTypedef(const cling::LookupHelper &lh, const char *name, bool replace=false)
Definition: TMetaUtils.cxx:352
clang::TemplateName ExtractTemplateNameFromQualType(const clang::QualType &qt)
These manipulations are necessary because a template specialisation type does not inherit from a reco...
bool QualType2Template(const clang::QualType &qt, clang::ClassTemplateDecl *&ctd, clang::ClassTemplateSpecializationDecl *&ctsd)
Get the template specialisation decl and template decl behind the qualtype Returns true if successful...
static const std::string ioname("ioname")
bool HasCustomOperatorNewArrayPlacement(clang::RecordDecl const &, const cling::Interpreter &interp)
return true if we can find a custom operator new with placement
double result[121]
AnnotatedRecordDecl(long index, const clang::RecordDecl *decl, bool rStreamerInfo, bool rNoStreamer, bool rRequestNoInputOperator, bool rRequestOnlyTClass, int rRequestedVersionNumber, const cling::Interpreter &interpret, const TNormalizedCtxt &normCtxt)
There is no requested type name.
Definition: TMetaUtils.cxx:364
bool IsOfType(const clang::CXXRecordDecl &cl, const std::string &type, const cling::LookupHelper &lh)
void WriteClassCode(CallWriteStreamer_t WriteStreamerFunc, const AnnotatedRecordDecl &cl, const cling::Interpreter &interp, const TNormalizedCtxt &normCtxt, std::ostream &finalString, const RConstructorTypes &ctorTypes, bool isGenreflex)
Generate the code of the class If the requestor is genreflex, request the new streamer format...
static void output(int code)
Definition: gifencode.c:226
const clang::CXXRecordDecl * fArgType
Definition: TMetaUtils.h:293
bool HasResetAfterMerge(clang::CXXRecordDecl const *, const cling::Interpreter &)
Return true if the class has a method ResetAfterMerge(TFileMergeInfo *)
bool HasCustomOperatorNewPlacement(char const *, clang::RecordDecl const &, const cling::Interpreter &)
return true if we can find a custom operator new with placement
clang::ClassTemplateDecl * QualType2ClassTemplateDecl(const clang::QualType &qt)
Extract from a qualtype the class template if this makes sense.
bool HasIOConstructor(clang::CXXRecordDecl const *, std::string &, const RConstructorTypes &, const cling::Interpreter &)
return true if we can find an constructor calleable without any arguments or with one the IOCtor spec...
void ExtractEnclosingNameSpaces(const clang::Decl &, std::list< std::pair< std::string, bool > > &)
Extract the immediately outer namespace and then launch the recursion.
clang::QualType GetNormalizedType(const clang::QualType &type, const cling::Interpreter &interpreter, const TNormalizedCtxt &normCtxt)
Return the type normalized for ROOT, keeping only the ROOT opaque typedef (Double32_t, etc.) and adding default template argument for all types except those explicitly requested to be drop by the user.
void Fatal(const char *location, const char *va_(fmt),...)
Use this function in case of a fatal error. It will abort the program.
TNormalizedCtxtImpl * fImpl
Definition: TMetaUtils.h:127
clang::QualType AddDefaultParameters(clang::QualType instanceType, const cling::Interpreter &interpret, const TNormalizedCtxt &normCtxt)
Add any unspecified template parameters to the class template instance, mentioned anywhere in the typ...