Coverage Report

Created: 2020-09-22 08:39

/Users/buildslave/jenkins/workspace/coverage/llvm-project/clang/include/clang/Sema/Sema.h
Line
Count
Source (jump to first uncovered line)
1
//===--- Sema.h - Semantic Analysis & AST Building --------------*- C++ -*-===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
//
9
// This file defines the Sema class, which performs semantic analysis and
10
// builds ASTs.
11
//
12
//===----------------------------------------------------------------------===//
13
14
#ifndef LLVM_CLANG_SEMA_SEMA_H
15
#define LLVM_CLANG_SEMA_SEMA_H
16
17
#include "clang/AST/ASTConcept.h"
18
#include "clang/AST/ASTFwd.h"
19
#include "clang/AST/Attr.h"
20
#include "clang/AST/Availability.h"
21
#include "clang/AST/ComparisonCategories.h"
22
#include "clang/AST/DeclTemplate.h"
23
#include "clang/AST/DeclarationName.h"
24
#include "clang/AST/Expr.h"
25
#include "clang/AST/ExprCXX.h"
26
#include "clang/AST/ExprConcepts.h"
27
#include "clang/AST/ExprObjC.h"
28
#include "clang/AST/ExprOpenMP.h"
29
#include "clang/AST/ExternalASTSource.h"
30
#include "clang/AST/LocInfoType.h"
31
#include "clang/AST/MangleNumberingContext.h"
32
#include "clang/AST/NSAPI.h"
33
#include "clang/AST/PrettyPrinter.h"
34
#include "clang/AST/StmtCXX.h"
35
#include "clang/AST/TypeLoc.h"
36
#include "clang/AST/TypeOrdering.h"
37
#include "clang/Basic/BitmaskEnum.h"
38
#include "clang/Basic/ExpressionTraits.h"
39
#include "clang/Basic/Module.h"
40
#include "clang/Basic/OpenCLOptions.h"
41
#include "clang/Basic/OpenMPKinds.h"
42
#include "clang/Basic/PragmaKinds.h"
43
#include "clang/Basic/Specifiers.h"
44
#include "clang/Basic/TemplateKinds.h"
45
#include "clang/Basic/TypeTraits.h"
46
#include "clang/Sema/AnalysisBasedWarnings.h"
47
#include "clang/Sema/CleanupInfo.h"
48
#include "clang/Sema/DeclSpec.h"
49
#include "clang/Sema/ExternalSemaSource.h"
50
#include "clang/Sema/IdentifierResolver.h"
51
#include "clang/Sema/ObjCMethodList.h"
52
#include "clang/Sema/Ownership.h"
53
#include "clang/Sema/Scope.h"
54
#include "clang/Sema/SemaConcept.h"
55
#include "clang/Sema/TypoCorrection.h"
56
#include "clang/Sema/Weak.h"
57
#include "llvm/ADT/ArrayRef.h"
58
#include "llvm/ADT/Optional.h"
59
#include "llvm/ADT/SetVector.h"
60
#include "llvm/ADT/SmallBitVector.h"
61
#include "llvm/ADT/SmallSet.h"
62
#include "llvm/ADT/SmallPtrSet.h"
63
#include "llvm/ADT/SmallVector.h"
64
#include "llvm/ADT/TinyPtrVector.h"
65
#include "llvm/Frontend/OpenMP/OMPConstants.h"
66
#include <deque>
67
#include <memory>
68
#include <string>
69
#include <tuple>
70
#include <vector>
71
72
namespace llvm {
73
  class APSInt;
74
  template <typename ValueT> struct DenseMapInfo;
75
  template <typename ValueT, typename ValueInfoT> class DenseSet;
76
  class SmallBitVector;
77
  struct InlineAsmIdentifierInfo;
78
}
79
80
namespace clang {
81
  class ADLResult;
82
  class ASTConsumer;
83
  class ASTContext;
84
  class ASTMutationListener;
85
  class ASTReader;
86
  class ASTWriter;
87
  class ArrayType;
88
  class ParsedAttr;
89
  class BindingDecl;
90
  class BlockDecl;
91
  class CapturedDecl;
92
  class CXXBasePath;
93
  class CXXBasePaths;
94
  class CXXBindTemporaryExpr;
95
  typedef SmallVector<CXXBaseSpecifier*, 4> CXXCastPath;
96
  class CXXConstructorDecl;
97
  class CXXConversionDecl;
98
  class CXXDeleteExpr;
99
  class CXXDestructorDecl;
100
  class CXXFieldCollector;
101
  class CXXMemberCallExpr;
102
  class CXXMethodDecl;
103
  class CXXScopeSpec;
104
  class CXXTemporary;
105
  class CXXTryStmt;
106
  class CallExpr;
107
  class ClassTemplateDecl;
108
  class ClassTemplatePartialSpecializationDecl;
109
  class ClassTemplateSpecializationDecl;
110
  class VarTemplatePartialSpecializationDecl;
111
  class CodeCompleteConsumer;
112
  class CodeCompletionAllocator;
113
  class CodeCompletionTUInfo;
114
  class CodeCompletionResult;
115
  class CoroutineBodyStmt;
116
  class Decl;
117
  class DeclAccessPair;
118
  class DeclContext;
119
  class DeclRefExpr;
120
  class DeclaratorDecl;
121
  class DeducedTemplateArgument;
122
  class DependentDiagnostic;
123
  class DesignatedInitExpr;
124
  class Designation;
125
  class EnableIfAttr;
126
  class EnumConstantDecl;
127
  class Expr;
128
  class ExtVectorType;
129
  class FormatAttr;
130
  class FriendDecl;
131
  class FunctionDecl;
132
  class FunctionProtoType;
133
  class FunctionTemplateDecl;
134
  class ImplicitConversionSequence;
135
  typedef MutableArrayRef<ImplicitConversionSequence> ConversionSequenceList;
136
  class InitListExpr;
137
  class InitializationKind;
138
  class InitializationSequence;
139
  class InitializedEntity;
140
  class IntegerLiteral;
141
  class LabelStmt;
142
  class LambdaExpr;
143
  class LangOptions;
144
  class LocalInstantiationScope;
145
  class LookupResult;
146
  class MacroInfo;
147
  typedef ArrayRef<std::pair<IdentifierInfo *, SourceLocation>> ModuleIdPath;
148
  class ModuleLoader;
149
  class MultiLevelTemplateArgumentList;
150
  class NamedDecl;
151
  class ObjCCategoryDecl;
152
  class ObjCCategoryImplDecl;
153
  class ObjCCompatibleAliasDecl;
154
  class ObjCContainerDecl;
155
  class ObjCImplDecl;
156
  class ObjCImplementationDecl;
157
  class ObjCInterfaceDecl;
158
  class ObjCIvarDecl;
159
  template <class T> class ObjCList;
160
  class ObjCMessageExpr;
161
  class ObjCMethodDecl;
162
  class ObjCPropertyDecl;
163
  class ObjCProtocolDecl;
164
  class OMPThreadPrivateDecl;
165
  class OMPRequiresDecl;
166
  class OMPDeclareReductionDecl;
167
  class OMPDeclareSimdDecl;
168
  class OMPClause;
169
  struct OMPVarListLocTy;
170
  struct OverloadCandidate;
171
  enum class OverloadCandidateParamOrder : char;
172
  enum OverloadCandidateRewriteKind : unsigned;
173
  class OverloadCandidateSet;
174
  class OverloadExpr;
175
  class ParenListExpr;
176
  class ParmVarDecl;
177
  class Preprocessor;
178
  class PseudoDestructorTypeStorage;
179
  class PseudoObjectExpr;
180
  class QualType;
181
  class StandardConversionSequence;
182
  class Stmt;
183
  class StringLiteral;
184
  class SwitchStmt;
185
  class TemplateArgument;
186
  class TemplateArgumentList;
187
  class TemplateArgumentLoc;
188
  class TemplateDecl;
189
  class TemplateInstantiationCallback;
190
  class TemplateParameterList;
191
  class TemplatePartialOrderingContext;
192
  class TemplateTemplateParmDecl;
193
  class Token;
194
  class TypeAliasDecl;
195
  class TypedefDecl;
196
  class TypedefNameDecl;
197
  class TypeLoc;
198
  class TypoCorrectionConsumer;
199
  class UnqualifiedId;
200
  class UnresolvedLookupExpr;
201
  class UnresolvedMemberExpr;
202
  class UnresolvedSetImpl;
203
  class UnresolvedSetIterator;
204
  class UsingDecl;
205
  class UsingShadowDecl;
206
  class ValueDecl;
207
  class VarDecl;
208
  class VarTemplateSpecializationDecl;
209
  class VisibilityAttr;
210
  class VisibleDeclConsumer;
211
  class IndirectFieldDecl;
212
  struct DeductionFailureInfo;
213
  class TemplateSpecCandidateSet;
214
215
namespace sema {
216
  class AccessedEntity;
217
  class BlockScopeInfo;
218
  class Capture;
219
  class CapturedRegionScopeInfo;
220
  class CapturingScopeInfo;
221
  class CompoundScopeInfo;
222
  class DelayedDiagnostic;
223
  class DelayedDiagnosticPool;
224
  class FunctionScopeInfo;
225
  class LambdaScopeInfo;
226
  class PossiblyUnreachableDiag;
227
  class SemaPPCallbacks;
228
  class TemplateDeductionInfo;
229
}
230
231
namespace threadSafety {
232
  class BeforeSet;
233
  void threadSafetyCleanup(BeforeSet* Cache);
234
}
235
236
// FIXME: No way to easily map from TemplateTypeParmTypes to
237
// TemplateTypeParmDecls, so we have this horrible PointerUnion.
238
typedef std::pair<llvm::PointerUnion<const TemplateTypeParmType*, NamedDecl*>,
239
                  SourceLocation> UnexpandedParameterPack;
240
241
/// Describes whether we've seen any nullability information for the given
242
/// file.
243
struct FileNullability {
244
  /// The first pointer declarator (of any pointer kind) in the file that does
245
  /// not have a corresponding nullability annotation.
246
  SourceLocation PointerLoc;
247
248
  /// The end location for the first pointer declarator in the file. Used for
249
  /// placing fix-its.
250
  SourceLocation PointerEndLoc;
251
252
  /// Which kind of pointer declarator we saw.
253
  uint8_t PointerKind;
254
255
  /// Whether we saw any type nullability annotations in the given file.
256
  bool SawTypeNullability = false;
257
};
258
259
/// A mapping from file IDs to a record of whether we've seen nullability
260
/// information in that file.
261
class FileNullabilityMap {
262
  /// A mapping from file IDs to the nullability information for each file ID.
263
  llvm::DenseMap<FileID, FileNullability> Map;
264
265
  /// A single-element cache based on the file ID.
266
  struct {
267
    FileID File;
268
    FileNullability Nullability;
269
  } Cache;
270
271
public:
272
34.2k
  FileNullability &operator[](FileID file) {
273
    // Check the single-element cache.
274
34.2k
    if (file == Cache.File)
275
31.3k
      return Cache.Nullability;
276
277
    // It's not in the single-element cache; flush the cache if we have one.
278
2.87k
    if (!Cache.File.isInvalid()) {
279
1.49k
      Map[Cache.File] = Cache.Nullability;
280
1.49k
    }
281
282
    // Pull this entry into the cache.
283
2.87k
    Cache.File = file;
284
2.87k
    Cache.Nullability = Map[file];
285
2.87k
    return Cache.Nullability;
286
2.87k
  }
287
};
288
289
/// Keeps track of expected type during expression parsing. The type is tied to
290
/// a particular token, all functions that update or consume the type take a
291
/// start location of the token they are looking at as a parameter. This allows
292
/// to avoid updating the type on hot paths in the parser.
293
class PreferredTypeBuilder {
294
public:
295
3.15M
  PreferredTypeBuilder() = default;
296
0
  explicit PreferredTypeBuilder(QualType Type) : Type(Type) {}
297
298
  void enterCondition(Sema &S, SourceLocation Tok);
299
  void enterReturn(Sema &S, SourceLocation Tok);
300
  void enterVariableInit(SourceLocation Tok, Decl *D);
301
  /// Computing a type for the function argument may require running
302
  /// overloading, so we postpone its computation until it is actually needed.
303
  ///
304
  /// Clients should be very careful when using this funciton, as it stores a
305
  /// function_ref, clients should make sure all calls to get() with the same
306
  /// location happen while function_ref is alive.
307
  void enterFunctionArgument(SourceLocation Tok,
308
                             llvm::function_ref<QualType()> ComputeType);
309
310
  void enterParenExpr(SourceLocation Tok, SourceLocation LParLoc);
311
  void enterUnary(Sema &S, SourceLocation Tok, tok::TokenKind OpKind,
312
                  SourceLocation OpLoc);
313
  void enterBinary(Sema &S, SourceLocation Tok, Expr *LHS, tok::TokenKind Op);
314
  void enterMemAccess(Sema &S, SourceLocation Tok, Expr *Base);
315
  void enterSubscript(Sema &S, SourceLocation Tok, Expr *LHS);
316
  /// Handles all type casts, including C-style cast, C++ casts, etc.
317
  void enterTypeCast(SourceLocation Tok, QualType CastType);
318
319
2.34M
  QualType get(SourceLocation Tok) const {
320
2.34M
    if (Tok != ExpectedLoc)
321
1.45M
      return QualType();
322
894k
    if (!Type.isNull())
323
352k
      return Type;
324
542k
    if (ComputeType)
325
199
      return ComputeType();
326
541k
    return QualType();
327
541k
  }
328
329
private:
330
  /// Start position of a token for which we store expected type.
331
  SourceLocation ExpectedLoc;
332
  /// Expected type for a token starting at ExpectedLoc.
333
  QualType Type;
334
  /// A function to compute expected type at ExpectedLoc. It is only considered
335
  /// if Type is null.
336
  llvm::function_ref<QualType()> ComputeType;
337
};
338
339
/// Sema - This implements semantic analysis and AST building for C.
340
class Sema final {
341
  Sema(const Sema &) = delete;
342
  void operator=(const Sema &) = delete;
343
344
  /// A key method to reduce duplicate debug info from Sema.
345
  virtual void anchor();
346
347
  ///Source of additional semantic information.
348
  ExternalSemaSource *ExternalSource;
349
350
  ///Whether Sema has generated a multiplexer and has to delete it.
351
  bool isMultiplexExternalSource;
352
353
  static bool mightHaveNonExternalLinkage(const DeclaratorDecl *FD);
354
355
  bool isVisibleSlow(const NamedDecl *D);
356
357
  /// Determine whether two declarations should be linked together, given that
358
  /// the old declaration might not be visible and the new declaration might
359
  /// not have external linkage.
360
  bool shouldLinkPossiblyHiddenDecl(const NamedDecl *Old,
361
183k
                                    const NamedDecl *New) {
362
183k
    if (isVisible(Old))
363
183k
     return true;
364
    // See comment in below overload for why it's safe to compute the linkage
365
    // of the new declaration here.
366
157
    if (New->isExternallyDeclarable()) {
367
156
      assert(Old->isExternallyDeclarable() &&
368
156
             "should not have found a non-externally-declarable previous decl");
369
156
      return true;
370
156
    }
371
1
    return false;
372
1
  }
373
  bool shouldLinkPossiblyHiddenDecl(LookupResult &Old, const NamedDecl *New);
374
375
  void setupImplicitSpecialMemberType(CXXMethodDecl *SpecialMem,
376
                                      QualType ResultTy,
377
                                      ArrayRef<QualType> Args);
378
379
public:
380
  /// The maximum alignment, same as in llvm::Value. We duplicate them here
381
  /// because that allows us not to duplicate the constants in clang code,
382
  /// which we must to since we can't directly use the llvm constants.
383
  /// The value is verified against llvm here: lib/CodeGen/CGDecl.cpp
384
  ///
385
  /// This is the greatest alignment value supported by load, store, and alloca
386
  /// instructions, and global values.
387
  static const unsigned MaxAlignmentExponent = 29;
388
  static const unsigned MaximumAlignment = 1u << MaxAlignmentExponent;
389
390
  typedef OpaquePtr<DeclGroupRef> DeclGroupPtrTy;
391
  typedef OpaquePtr<TemplateName> TemplateTy;
392
  typedef OpaquePtr<QualType> TypeTy;
393
394
  OpenCLOptions OpenCLFeatures;
395
  FPOptions CurFPFeatures;
396
397
  const LangOptions &LangOpts;
398
  Preprocessor &PP;
399
  ASTContext &Context;
400
  ASTConsumer &Consumer;
401
  DiagnosticsEngine &Diags;
402
  SourceManager &SourceMgr;
403
404
  /// Flag indicating whether or not to collect detailed statistics.
405
  bool CollectStats;
406
407
  /// Code-completion consumer.
408
  CodeCompleteConsumer *CodeCompleter;
409
410
  /// CurContext - This is the current declaration context of parsing.
411
  DeclContext *CurContext;
412
413
  /// Generally null except when we temporarily switch decl contexts,
414
  /// like in \see ActOnObjCTemporaryExitContainerContext.
415
  DeclContext *OriginalLexicalContext;
416
417
  /// VAListTagName - The declaration name corresponding to __va_list_tag.
418
  /// This is used as part of a hack to omit that class from ADL results.
419
  DeclarationName VAListTagName;
420
421
  bool MSStructPragmaOn; // True when \#pragma ms_struct on
422
423
  /// Controls member pointer representation format under the MS ABI.
424
  LangOptions::PragmaMSPointersToMembersKind
425
      MSPointerToMemberRepresentationMethod;
426
427
  /// Stack of active SEH __finally scopes.  Can be empty.
428
  SmallVector<Scope*, 2> CurrentSEHFinally;
429
430
  /// Source location for newly created implicit MSInheritanceAttrs
431
  SourceLocation ImplicitMSInheritanceAttrLoc;
432
433
  /// Holds TypoExprs that are created from `createDelayedTypo`. This is used by
434
  /// `TransformTypos` in order to keep track of any TypoExprs that are created
435
  /// recursively during typo correction and wipe them away if the correction
436
  /// fails.
437
  llvm::SmallVector<TypoExpr *, 2> TypoExprs;
438
439
  /// pragma clang section kind
440
  enum PragmaClangSectionKind {
441
    PCSK_Invalid      = 0,
442
    PCSK_BSS          = 1,
443
    PCSK_Data         = 2,
444
    PCSK_Rodata       = 3,
445
    PCSK_Text         = 4,
446
    PCSK_Relro        = 5
447
   };
448
449
  enum PragmaClangSectionAction {
450
    PCSA_Set     = 0,
451
    PCSA_Clear   = 1
452
  };
453
454
  struct PragmaClangSection {
455
    std::string SectionName;
456
    bool Valid = false;
457
    SourceLocation PragmaLocation;
458
459
    void Act(SourceLocation PragmaLocation,
460
             PragmaClangSectionAction Action,
461
             StringLiteral* Name);
462
   };
463
464
   PragmaClangSection PragmaClangBSSSection;
465
   PragmaClangSection PragmaClangDataSection;
466
   PragmaClangSection PragmaClangRodataSection;
467
   PragmaClangSection PragmaClangRelroSection;
468
   PragmaClangSection PragmaClangTextSection;
469
470
  enum PragmaMsStackAction {
471
    PSK_Reset     = 0x0,                // #pragma ()
472
    PSK_Set       = 0x1,                // #pragma (value)
473
    PSK_Push      = 0x2,                // #pragma (push[, id])
474
    PSK_Pop       = 0x4,                // #pragma (pop[, id])
475
    PSK_Show      = 0x8,                // #pragma (show) -- only for "pack"!
476
    PSK_Push_Set  = PSK_Push | PSK_Set, // #pragma (push[, id], value)
477
    PSK_Pop_Set   = PSK_Pop | PSK_Set,  // #pragma (pop[, id], value)
478
  };
479
480
  template<typename ValueType>
481
  struct PragmaStack {
482
    struct Slot {
483
      llvm::StringRef StackSlotLabel;
484
      ValueType Value;
485
      SourceLocation PragmaLocation;
486
      SourceLocation PragmaPushLocation;
487
      Slot(llvm::StringRef StackSlotLabel, ValueType Value,
488
           SourceLocation PragmaLocation, SourceLocation PragmaPushLocation)
489
          : StackSlotLabel(StackSlotLabel), Value(Value),
490
            PragmaLocation(PragmaLocation),
491
3.22M
            PragmaPushLocation(PragmaPushLocation) {}
clang::Sema::PragmaStack<unsigned int>::Slot::Slot(llvm::StringRef, unsigned int, clang::SourceLocation, clang::SourceLocation)
Line
Count
Source
491
165k
            PragmaPushLocation(PragmaPushLocation) {}
clang::Sema::PragmaStack<clang::FPOptionsOverride>::Slot::Slot(llvm::StringRef, clang::FPOptionsOverride, clang::SourceLocation, clang::SourceLocation)
Line
Count
Source
491
34
            PragmaPushLocation(PragmaPushLocation) {}
clang::Sema::PragmaStack<clang::MSVtorDispMode>::Slot::Slot(llvm::StringRef, clang::MSVtorDispMode, clang::SourceLocation, clang::SourceLocation)
Line
Count
Source
491
611k
            PragmaPushLocation(PragmaPushLocation) {}
clang::Sema::PragmaStack<clang::StringLiteral*>::Slot::Slot(llvm::StringRef, clang::StringLiteral*, clang::SourceLocation, clang::SourceLocation)
Line
Count
Source
491
2.44M
            PragmaPushLocation(PragmaPushLocation) {}
492
    };
493
494
    void Act(SourceLocation PragmaLocation, PragmaMsStackAction Action,
495
7.02M
             llvm::StringRef StackSlotLabel, ValueType Value) {
496
7.02M
      if (Action == PSK_Reset) {
497
585k
        CurrentValue = DefaultValue;
498
585k
        CurrentPragmaLocation = PragmaLocation;
499
585k
        return;
500
585k
      }
501
6.44M
      if (Action & PSK_Push)
502
3.22M
        Stack.emplace_back(StackSlotLabel, CurrentValue, CurrentPragmaLocation,
503
3.22M
                           PragmaLocation);
504
3.22M
      else if (Action & PSK_Pop) {
505
3.22M
        if (!StackSlotLabel.empty()) {
506
          // If we've got a label, try to find it and jump there.
507
3.05M
          auto I = llvm::find_if(llvm::reverse(Stack), [&](const Slot &x) {
508
3.05M
            return x.StackSlotLabel == StackSlotLabel;
509
3.05M
          });
clang::Sema::PragmaStack<unsigned int>::Act(clang::SourceLocation, clang::Sema::PragmaMsStackAction, llvm::StringRef, unsigned int)::'lambda'(clang::Sema::PragmaStack<unsigned int>::Slot const&)::operator()(clang::Sema::PragmaStack<unsigned int>::Slot const&) const
Line
Count
Source
507
10
          auto I = llvm::find_if(llvm::reverse(Stack), [&](const Slot &x) {
508
10
            return x.StackSlotLabel == StackSlotLabel;
509
10
          });
Unexecuted instantiation: clang::Sema::PragmaStack<clang::FPOptionsOverride>::Act(clang::SourceLocation, clang::Sema::PragmaMsStackAction, llvm::StringRef, clang::FPOptionsOverride)::'lambda'(clang::Sema::PragmaStack<clang::FPOptionsOverride>::Slot const&)::operator()(clang::Sema::PragmaStack<clang::FPOptionsOverride>::Slot const&) const
clang::Sema::PragmaStack<clang::MSVtorDispMode>::Act(clang::SourceLocation, clang::Sema::PragmaMsStackAction, llvm::StringRef, clang::MSVtorDispMode)::'lambda'(clang::Sema::PragmaStack<clang::MSVtorDispMode>::Slot const&)::operator()(clang::Sema::PragmaStack<clang::MSVtorDispMode>::Slot const&) const
Line
Count
Source
507
611k
          auto I = llvm::find_if(llvm::reverse(Stack), [&](const Slot &x) {
508
611k
            return x.StackSlotLabel == StackSlotLabel;
509
611k
          });
clang::Sema::PragmaStack<clang::StringLiteral*>::Act(clang::SourceLocation, clang::Sema::PragmaMsStackAction, llvm::StringRef, clang::StringLiteral*)::'lambda'(clang::Sema::PragmaStack<clang::StringLiteral*>::Slot const&)::operator()(clang::Sema::PragmaStack<clang::StringLiteral*>::Slot const&) const
Line
Count
Source
507
2.44M
          auto I = llvm::find_if(llvm::reverse(Stack), [&](const Slot &x) {
508
2.44M
            return x.StackSlotLabel == StackSlotLabel;
509
2.44M
          });
510
          // If we found the label so pop from there.
511
3.05M
          if (I != Stack.rend()) {
512
3.05M
            CurrentValue = I->Value;
513
3.05M
            CurrentPragmaLocation = I->PragmaLocation;
514
3.05M
            Stack.erase(std::prev(I.base()), Stack.end());
515
3.05M
          }
516
165k
        } else if (!Stack.empty()) {
517
          // We do not have a label, just pop the last entry.
518
165k
          CurrentValue = Stack.back().Value;
519
165k
          CurrentPragmaLocation = Stack.back().PragmaLocation;
520
165k
          Stack.pop_back();
521
165k
        }
522
3.22M
      }
523
6.44M
      if (Action & PSK_Set) {
524
167k
        CurrentValue = Value;
525
167k
        CurrentPragmaLocation = PragmaLocation;
526
167k
      }
527
6.44M
    }
clang::Sema::PragmaStack<unsigned int>::Act(clang::SourceLocation, clang::Sema::PragmaMsStackAction, llvm::StringRef, unsigned int)
Line
Count
Source
495
334k
             llvm::StringRef StackSlotLabel, ValueType Value) {
496
334k
      if (Action == PSK_Reset) {
497
2.25k
        CurrentValue = DefaultValue;
498
2.25k
        CurrentPragmaLocation = PragmaLocation;
499
2.25k
        return;
500
2.25k
      }
501
332k
      if (Action & PSK_Push)
502
165k
        Stack.emplace_back(StackSlotLabel, CurrentValue, CurrentPragmaLocation,
503
165k
                           PragmaLocation);
504
167k
      else if (Action & PSK_Pop) {
505
165k
        if (!StackSlotLabel.empty()) {
506
          // If we've got a label, try to find it and jump there.
507
9
          auto I = llvm::find_if(llvm::reverse(Stack), [&](const Slot &x) {
508
9
            return x.StackSlotLabel == StackSlotLabel;
509
9
          });
510
          // If we found the label so pop from there.
511
9
          if (I != Stack.rend()) {
512
5
            CurrentValue = I->Value;
513
5
            CurrentPragmaLocation = I->PragmaLocation;
514
5
            Stack.erase(std::prev(I.base()), Stack.end());
515
5
          }
516
165k
        } else if (!Stack.empty()) {
517
          // We do not have a label, just pop the last entry.
518
165k
          CurrentValue = Stack.back().Value;
519
165k
          CurrentPragmaLocation = Stack.back().PragmaLocation;
520
165k
          Stack.pop_back();
521
165k
        }
522
165k
      }
523
332k
      if (Action & PSK_Set) {
524
167k
        CurrentValue = Value;
525
167k
        CurrentPragmaLocation = PragmaLocation;
526
167k
      }
527
332k
    }
clang::Sema::PragmaStack<clang::FPOptionsOverride>::Act(clang::SourceLocation, clang::Sema::PragmaMsStackAction, llvm::StringRef, clang::FPOptionsOverride)
Line
Count
Source
495
583k
             llvm::StringRef StackSlotLabel, ValueType Value) {
496
583k
      if (Action == PSK_Reset) {
497
583k
        CurrentValue = DefaultValue;
498
583k
        CurrentPragmaLocation = PragmaLocation;
499
583k
        return;
500
583k
      }
501
266
      if (Action & PSK_Push)
502
32
        Stack.emplace_back(StackSlotLabel, CurrentValue, CurrentPragmaLocation,
503
32
                           PragmaLocation);
504
234
      else if (Action & PSK_Pop) {
505
31
        if (!StackSlotLabel.empty()) {
506
          // If we've got a label, try to find it and jump there.
507
0
          auto I = llvm::find_if(llvm::reverse(Stack), [&](const Slot &x) {
508
0
            return x.StackSlotLabel == StackSlotLabel;
509
0
          });
510
          // If we found the label so pop from there.
511
0
          if (I != Stack.rend()) {
512
0
            CurrentValue = I->Value;
513
0
            CurrentPragmaLocation = I->PragmaLocation;
514
0
            Stack.erase(std::prev(I.base()), Stack.end());
515
0
          }
516
31
        } else if (!Stack.empty()) {
517
          // We do not have a label, just pop the last entry.
518
31
          CurrentValue = Stack.back().Value;
519
31
          CurrentPragmaLocation = Stack.back().PragmaLocation;
520
31
          Stack.pop_back();
521
31
        }
522
31
      }
523
266
      if (Action & PSK_Set) {
524
235
        CurrentValue = Value;
525
235
        CurrentPragmaLocation = PragmaLocation;
526
235
      }
527
266
    }
clang::Sema::PragmaStack<clang::MSVtorDispMode>::Act(clang::SourceLocation, clang::Sema::PragmaMsStackAction, llvm::StringRef, clang::MSVtorDispMode)
Line
Count
Source
495
1.22M
             llvm::StringRef StackSlotLabel, ValueType Value) {
496
1.22M
      if (Action == PSK_Reset) {
497
3
        CurrentValue = DefaultValue;
498
3
        CurrentPragmaLocation = PragmaLocation;
499
3
        return;
500
3
      }
501
1.22M
      if (Action & PSK_Push)
502
611k
        Stack.emplace_back(StackSlotLabel, CurrentValue, CurrentPragmaLocation,
503
611k
                           PragmaLocation);
504
611k
      else if (Action & PSK_Pop) {
505
611k
        if (!StackSlotLabel.empty()) {
506
          // If we've got a label, try to find it and jump there.
507
611k
          auto I = llvm::find_if(llvm::reverse(Stack), [&](const Slot &x) {
508
611k
            return x.StackSlotLabel == StackSlotLabel;
509
611k
          });
510
          // If we found the label so pop from there.
511
611k
          if (I != Stack.rend()) {
512
611k
            CurrentValue = I->Value;
513
611k
            CurrentPragmaLocation = I->PragmaLocation;
514
611k
            Stack.erase(std::prev(I.base()), Stack.end());
515
611k
          }
516
20
        } else if (!Stack.empty()) {
517
          // We do not have a label, just pop the last entry.
518
16
          CurrentValue = Stack.back().Value;
519
16
          CurrentPragmaLocation = Stack.back().PragmaLocation;
520
16
          Stack.pop_back();
521
16
        }
522
611k
      }
523
1.22M
      if (Action & PSK_Set) {
524
22
        CurrentValue = Value;
525
22
        CurrentPragmaLocation = PragmaLocation;
526
22
      }
527
1.22M
    }
clang::Sema::PragmaStack<clang::StringLiteral*>::Act(clang::SourceLocation, clang::Sema::PragmaMsStackAction, llvm::StringRef, clang::StringLiteral*)
Line
Count
Source
495
4.88M
             llvm::StringRef StackSlotLabel, ValueType Value) {
496
4.88M
      if (Action == PSK_Reset) {
497
4
        CurrentValue = DefaultValue;
498
4
        CurrentPragmaLocation = PragmaLocation;
499
4
        return;
500
4
      }
501
4.88M
      if (Action & PSK_Push)
502
2.44M
        Stack.emplace_back(StackSlotLabel, CurrentValue, CurrentPragmaLocation,
503
2.44M
                           PragmaLocation);
504
2.44M
      else if (Action & PSK_Pop) {
505
2.44M
        if (!StackSlotLabel.empty()) {
506
          // If we've got a label, try to find it and jump there.
507
2.44M
          auto I = llvm::find_if(llvm::reverse(Stack), [&](const Slot &x) {
508
2.44M
            return x.StackSlotLabel == StackSlotLabel;
509
2.44M
          });
510
          // If we found the label so pop from there.
511
2.44M
          if (I != Stack.rend()) {
512
2.44M
            CurrentValue = I->Value;
513
2.44M
            CurrentPragmaLocation = I->PragmaLocation;
514
2.44M
            Stack.erase(std::prev(I.base()), Stack.end());
515
2.44M
          }
516
6
        } else if (!Stack.empty()) {
517
          // We do not have a label, just pop the last entry.
518
6
          CurrentValue = Stack.back().Value;
519
6
          CurrentPragmaLocation = Stack.back().PragmaLocation;
520
6
          Stack.pop_back();
521
6
        }
522
2.44M
      }
523
4.88M
      if (Action & PSK_Set) {
524
44
        CurrentValue = Value;
525
44
        CurrentPragmaLocation = PragmaLocation;
526
44
      }
527
4.88M
    }
528
529
    // MSVC seems to add artificial slots to #pragma stacks on entering a C++
530
    // method body to restore the stacks on exit, so it works like this:
531
    //
532
    //   struct S {
533
    //     #pragma <name>(push, InternalPragmaSlot, <current_pragma_value>)
534
    //     void Method {}
535
    //     #pragma <name>(pop, InternalPragmaSlot)
536
    //   };
537
    //
538
    // It works even with #pragma vtordisp, although MSVC doesn't support
539
    //   #pragma vtordisp(push [, id], n)
540
    // syntax.
541
    //
542
    // Push / pop a named sentinel slot.
543
6.11M
    void SentinelAction(PragmaMsStackAction Action, StringRef Label) {
544
6.11M
      assert((Action == PSK_Push || Action == PSK_Pop) &&
545
6.11M
             "Can only push / pop #pragma stack sentinels!");
546
6.11M
      Act(CurrentPragmaLocation, Action, Label, CurrentValue);
547
6.11M
    }
clang::Sema::PragmaStack<clang::MSVtorDispMode>::SentinelAction(clang::Sema::PragmaMsStackAction, llvm::StringRef)
Line
Count
Source
543
1.22M
    void SentinelAction(PragmaMsStackAction Action, StringRef Label) {
544
1.22M
      assert((Action == PSK_Push || Action == PSK_Pop) &&
545
1.22M
             "Can only push / pop #pragma stack sentinels!");
546
1.22M
      Act(CurrentPragmaLocation, Action, Label, CurrentValue);
547
1.22M
    }
clang::Sema::PragmaStack<clang::StringLiteral*>::SentinelAction(clang::Sema::PragmaMsStackAction, llvm::StringRef)
Line
Count
Source
543
4.88M
    void SentinelAction(PragmaMsStackAction Action, StringRef Label) {
544
4.88M
      assert((Action == PSK_Push || Action == PSK_Pop) &&
545
4.88M
             "Can only push / pop #pragma stack sentinels!");
546
4.88M
      Act(CurrentPragmaLocation, Action, Label, CurrentValue);
547
4.88M
    }
548
549
    // Constructors.
550
    explicit PragmaStack(const ValueType &Default)
551
532k
        : DefaultValue(Default), CurrentValue(Default) {}
clang::Sema::PragmaStack<clang::MSVtorDispMode>::PragmaStack(clang::MSVtorDispMode const&)
Line
Count
Source
551
76.0k
        : DefaultValue(Default), CurrentValue(Default) {}
clang::Sema::PragmaStack<unsigned int>::PragmaStack(unsigned int const&)
Line
Count
Source
551
76.0k
        : DefaultValue(Default), CurrentValue(Default) {}
clang::Sema::PragmaStack<clang::StringLiteral*>::PragmaStack(clang::StringLiteral* const&)
Line
Count
Source
551
304k
        : DefaultValue(Default), CurrentValue(Default) {}
clang::Sema::PragmaStack<clang::FPOptionsOverride>::PragmaStack(clang::FPOptionsOverride const&)
Line
Count
Source
551
76.0k
        : DefaultValue(Default), CurrentValue(Default) {}
552
553
28.5M
    bool hasValue() const { return CurrentValue != DefaultValue; }
clang::Sema::PragmaStack<clang::FPOptionsOverride>::hasValue() const
Line
Count
Source
553
27.5M
    bool hasValue() const { return CurrentValue != DefaultValue; }
clang::Sema::PragmaStack<unsigned int>::hasValue() const
Line
Count
Source
553
1.04M
    bool hasValue() const { return CurrentValue != DefaultValue; }
554
555
    SmallVector<Slot, 2> Stack;
556
    ValueType DefaultValue; // Value used for PSK_Reset action.
557
    ValueType CurrentValue;
558
    SourceLocation CurrentPragmaLocation;
559
  };
560
  // FIXME: We should serialize / deserialize these if they occur in a PCH (but
561
  // we shouldn't do so if they're in a module).
562
563
  /// Whether to insert vtordisps prior to virtual bases in the Microsoft
564
  /// C++ ABI.  Possible values are 0, 1, and 2, which mean:
565
  ///
566
  /// 0: Suppress all vtordisps
567
  /// 1: Insert vtordisps in the presence of vbase overrides and non-trivial
568
  ///    structors
569
  /// 2: Always insert vtordisps to support RTTI on partially constructed
570
  ///    objects
571
  PragmaStack<MSVtorDispMode> VtorDispStack;
572
  // #pragma pack.
573
  // Sentinel to represent when the stack is set to mac68k alignment.
574
  static const unsigned kMac68kAlignmentSentinel = ~0U;
575
  PragmaStack<unsigned> PackStack;
576
  // The current #pragma pack values and locations at each #include.
577
  struct PackIncludeState {
578
    unsigned CurrentValue;
579
    SourceLocation CurrentPragmaLocation;
580
    bool HasNonDefaultValue, ShouldWarnOnInclude;
581
  };
582
  SmallVector<PackIncludeState, 8> PackIncludeStack;
583
  // Segment #pragmas.
584
  PragmaStack<StringLiteral *> DataSegStack;
585
  PragmaStack<StringLiteral *> BSSSegStack;
586
  PragmaStack<StringLiteral *> ConstSegStack;
587
  PragmaStack<StringLiteral *> CodeSegStack;
588
589
  // This stack tracks the current state of Sema.CurFPFeatures.
590
  PragmaStack<FPOptionsOverride> FpPragmaStack;
591
27.5M
  FPOptionsOverride CurFPFeatureOverrides() {
592
27.5M
    FPOptionsOverride result;
593
27.5M
    if (!FpPragmaStack.hasValue()) {
594
27.5M
      result = FPOptionsOverride();
595
631
    } else {
596
631
      result = FpPragmaStack.CurrentValue;
597
631
    }
598
27.5M
    return result;
599
27.5M
  }
600
601
  // RAII object to push / pop sentinel slots for all MS #pragma stacks.
602
  // Actions should be performed only if we enter / exit a C++ method body.
603
  class PragmaStackSentinelRAII {
604
  public:
605
    PragmaStackSentinelRAII(Sema &S, StringRef SlotLabel, bool ShouldAct);
606
    ~PragmaStackSentinelRAII();
607
608
  private:
609
    Sema &S;
610
    StringRef SlotLabel;
611
    bool ShouldAct;
612
  };
613
614
  /// A mapping that describes the nullability we've seen in each header file.
615
  FileNullabilityMap NullabilityMap;
616
617
  /// Last section used with #pragma init_seg.
618
  StringLiteral *CurInitSeg;
619
  SourceLocation CurInitSegLoc;
620
621
  /// VisContext - Manages the stack for \#pragma GCC visibility.
622
  void *VisContext; // Really a "PragmaVisStack*"
623
624
  /// This an attribute introduced by \#pragma clang attribute.
625
  struct PragmaAttributeEntry {
626
    SourceLocation Loc;
627
    ParsedAttr *Attribute;
628
    SmallVector<attr::SubjectMatchRule, 4> MatchRules;
629
    bool IsUsed;
630
  };
631
632
  /// A push'd group of PragmaAttributeEntries.
633
  struct PragmaAttributeGroup {
634
    /// The location of the push attribute.
635
    SourceLocation Loc;
636
    /// The namespace of this push group.
637
    const IdentifierInfo *Namespace;
638
    SmallVector<PragmaAttributeEntry, 2> Entries;
639
  };
640
641
  SmallVector<PragmaAttributeGroup, 2> PragmaAttributeStack;
642
643
  /// The declaration that is currently receiving an attribute from the
644
  /// #pragma attribute stack.
645
  const Decl *PragmaAttributeCurrentTargetDecl;
646
647
  /// This represents the last location of a "#pragma clang optimize off"
648
  /// directive if such a directive has not been closed by an "on" yet. If
649
  /// optimizations are currently "on", this is set to an invalid location.
650
  SourceLocation OptimizeOffPragmaLocation;
651
652
  /// Flag indicating if Sema is building a recovery call expression.
653
  ///
654
  /// This flag is used to avoid building recovery call expressions
655
  /// if Sema is already doing so, which would cause infinite recursions.
656
  bool IsBuildingRecoveryCallExpr;
657
658
  /// Used to control the generation of ExprWithCleanups.
659
  CleanupInfo Cleanup;
660
661
  /// ExprCleanupObjects - This is the stack of objects requiring
662
  /// cleanup that are created by the current full expression.
663
  SmallVector<ExprWithCleanups::CleanupObject, 8> ExprCleanupObjects;
664
665
  /// Store a set of either DeclRefExprs or MemberExprs that contain a reference
666
  /// to a variable (constant) that may or may not be odr-used in this Expr, and
667
  /// we won't know until all lvalue-to-rvalue and discarded value conversions
668
  /// have been applied to all subexpressions of the enclosing full expression.
669
  /// This is cleared at the end of each full expression.
670
  using MaybeODRUseExprSet = llvm::SetVector<Expr *, SmallVector<Expr *, 4>,
671
                                             llvm::SmallPtrSet<Expr *, 4>>;
672
  MaybeODRUseExprSet MaybeODRUseExprs;
673
674
  std::unique_ptr<sema::FunctionScopeInfo> CachedFunctionScope;
675
676
  /// Stack containing information about each of the nested
677
  /// function, block, and method scopes that are currently active.
678
  SmallVector<sema::FunctionScopeInfo *, 4> FunctionScopes;
679
680
  /// The index of the first FunctionScope that corresponds to the current
681
  /// context.
682
  unsigned FunctionScopesStart = 0;
683
684
345k
  ArrayRef<sema::FunctionScopeInfo*> getFunctionScopes() const {
685
345k
    return llvm::makeArrayRef(FunctionScopes.begin() + FunctionScopesStart,
686
345k
                              FunctionScopes.end());
687
345k
  }
688
689
  /// Stack containing information needed when in C++2a an 'auto' is encountered
690
  /// in a function declaration parameter type specifier in order to invent a
691
  /// corresponding template parameter in the enclosing abbreviated function
692
  /// template. This information is also present in LambdaScopeInfo, stored in
693
  /// the FunctionScopes stack.
694
  SmallVector<InventedTemplateParameterInfo, 4> InventedParameterInfos;
695
696
  /// The index of the first InventedParameterInfo that refers to the current
697
  /// context.
698
  unsigned InventedParameterInfosStart = 0;
699
700
345k
  ArrayRef<InventedTemplateParameterInfo> getInventedParameterInfos() const {
701
345k
    return llvm::makeArrayRef(InventedParameterInfos.begin() +
702
345k
                                  InventedParameterInfosStart,
703
345k
                              InventedParameterInfos.end());
704
345k
  }
705
706
  typedef LazyVector<TypedefNameDecl *, ExternalSemaSource,
707
                     &ExternalSemaSource::ReadExtVectorDecls, 2, 2>
708
    ExtVectorDeclsType;
709
710
  /// ExtVectorDecls - This is a list all the extended vector types. This allows
711
  /// us to associate a raw vector type with one of the ext_vector type names.
712
  /// This is only necessary for issuing pretty diagnostics.
713
  ExtVectorDeclsType ExtVectorDecls;
714
715
  /// FieldCollector - Collects CXXFieldDecls during parsing of C++ classes.
716
  std::unique_ptr<CXXFieldCollector> FieldCollector;
717
718
  typedef llvm::SmallSetVector<NamedDecl *, 16> NamedDeclSetType;
719
720
  /// Set containing all declared private fields that are not used.
721
  NamedDeclSetType UnusedPrivateFields;
722
723
  /// Set containing all typedefs that are likely unused.
724
  llvm::SmallSetVector<const TypedefNameDecl *, 4>
725
      UnusedLocalTypedefNameCandidates;
726
727
  /// Delete-expressions to be analyzed at the end of translation unit
728
  ///
729
  /// This list contains class members, and locations of delete-expressions
730
  /// that could not be proven as to whether they mismatch with new-expression
731
  /// used in initializer of the field.
732
  typedef std::pair<SourceLocation, bool> DeleteExprLoc;
733
  typedef llvm::SmallVector<DeleteExprLoc, 4> DeleteLocs;
734
  llvm::MapVector<FieldDecl *, DeleteLocs> DeleteExprs;
735
736
  typedef llvm::SmallPtrSet<const CXXRecordDecl*, 8> RecordDeclSetTy;
737
738
  /// PureVirtualClassDiagSet - a set of class declarations which we have
739
  /// emitted a list of pure virtual functions. Used to prevent emitting the
740
  /// same list more than once.
741
  std::unique_ptr<RecordDeclSetTy> PureVirtualClassDiagSet;
742
743
  /// ParsingInitForAutoVars - a set of declarations with auto types for which
744
  /// we are currently parsing the initializer.
745
  llvm::SmallPtrSet<const Decl*, 4> ParsingInitForAutoVars;
746
747
  /// Look for a locally scoped extern "C" declaration by the given name.
748
  NamedDecl *findLocallyScopedExternCDecl(DeclarationName Name);
749
750
  typedef LazyVector<VarDecl *, ExternalSemaSource,
751
                     &ExternalSemaSource::ReadTentativeDefinitions, 2, 2>
752
    TentativeDefinitionsType;
753
754
  /// All the tentative definitions encountered in the TU.
755
  TentativeDefinitionsType TentativeDefinitions;
756
757
  /// All the external declarations encoutered and used in the TU.
758
  SmallVector<VarDecl *, 4> ExternalDeclarations;
759
760
  typedef LazyVector<const DeclaratorDecl *, ExternalSemaSource,
761
                     &ExternalSemaSource::ReadUnusedFileScopedDecls, 2, 2>
762
    UnusedFileScopedDeclsType;
763
764
  /// The set of file scoped decls seen so far that have not been used
765
  /// and must warn if not used. Only contains the first declaration.
766
  UnusedFileScopedDeclsType UnusedFileScopedDecls;
767
768
  typedef LazyVector<CXXConstructorDecl *, ExternalSemaSource,
769
                     &ExternalSemaSource::ReadDelegatingConstructors, 2, 2>
770
    DelegatingCtorDeclsType;
771
772
  /// All the delegating constructors seen so far in the file, used for
773
  /// cycle detection at the end of the TU.
774
  DelegatingCtorDeclsType DelegatingCtorDecls;
775
776
  /// All the overriding functions seen during a class definition
777
  /// that had their exception spec checks delayed, plus the overridden
778
  /// function.
779
  SmallVector<std::pair<const CXXMethodDecl*, const CXXMethodDecl*>, 2>
780
    DelayedOverridingExceptionSpecChecks;
781
782
  /// All the function redeclarations seen during a class definition that had
783
  /// their exception spec checks delayed, plus the prior declaration they
784
  /// should be checked against. Except during error recovery, the new decl
785
  /// should always be a friend declaration, as that's the only valid way to
786
  /// redeclare a special member before its class is complete.
787
  SmallVector<std::pair<FunctionDecl*, FunctionDecl*>, 2>
788
    DelayedEquivalentExceptionSpecChecks;
789
790
  typedef llvm::MapVector<const FunctionDecl *,
791
                          std::unique_ptr<LateParsedTemplate>>
792
      LateParsedTemplateMapT;
793
  LateParsedTemplateMapT LateParsedTemplateMap;
794
795
  /// Callback to the parser to parse templated functions when needed.
796
  typedef void LateTemplateParserCB(void *P, LateParsedTemplate &LPT);
797
  typedef void LateTemplateParserCleanupCB(void *P);
798
  LateTemplateParserCB *LateTemplateParser;
799
  LateTemplateParserCleanupCB *LateTemplateParserCleanup;
800
  void *OpaqueParser;
801
802
  void SetLateTemplateParser(LateTemplateParserCB *LTP,
803
                             LateTemplateParserCleanupCB *LTPCleanup,
804
75.8k
                             void *P) {
805
75.8k
    LateTemplateParser = LTP;
806
75.8k
    LateTemplateParserCleanup = LTPCleanup;
807
75.8k
    OpaqueParser = P;
808
75.8k
  }
809
810
  class DelayedDiagnostics;
811
812
  class DelayedDiagnosticsState {
813
    sema::DelayedDiagnosticPool *SavedPool;
814
    friend class Sema::DelayedDiagnostics;
815
  };
816
  typedef DelayedDiagnosticsState ParsingDeclState;
817
  typedef DelayedDiagnosticsState ProcessingContextState;
818
819
  /// A class which encapsulates the logic for delaying diagnostics
820
  /// during parsing and other processing.
821
  class DelayedDiagnostics {
822
    /// The current pool of diagnostics into which delayed
823
    /// diagnostics should go.
824
    sema::DelayedDiagnosticPool *CurPool;
825
826
  public:
827
76.0k
    DelayedDiagnostics() : CurPool(nullptr) {}
828
829
    /// Adds a delayed diagnostic.
830
    void add(const sema::DelayedDiagnostic &diag); // in DelayedDiagnostic.h
831
832
    /// Determines whether diagnostics should be delayed.
833
1.86M
    bool shouldDelayDiagnostics() { return CurPool != nullptr; }
834
835
    /// Returns the current delayed-diagnostics pool.
836
118M
    sema::DelayedDiagnosticPool *getCurrentPool() const {
837
118M
      return CurPool;
838
118M
    }
839
840
    /// Enter a new scope.  Access and deprecation diagnostics will be
841
    /// collected in this pool.
842
58.9M
    DelayedDiagnosticsState push(sema::DelayedDiagnosticPool &pool) {
843
58.9M
      DelayedDiagnosticsState state;
844
58.9M
      state.SavedPool = CurPool;
845
58.9M
      CurPool = &pool;
846
58.9M
      return state;
847
58.9M
    }
848
849
    /// Leave a delayed-diagnostic state that was previously pushed.
850
    /// Do not emit any of the diagnostics.  This is performed as part
851
    /// of the bookkeeping of popping a pool "properly".
852
58.9M
    void popWithoutEmitting(DelayedDiagnosticsState state) {
853
58.9M
      CurPool = state.SavedPool;
854
58.9M
    }
855
856
    /// Enter a new scope where access and deprecation diagnostics are
857
    /// not delayed.
858
5.75M
    DelayedDiagnosticsState pushUndelayed() {
859
5.75M
      DelayedDiagnosticsState state;
860
5.75M
      state.SavedPool = CurPool;
861
5.75M
      CurPool = nullptr;
862
5.75M
      return state;
863
5.75M
    }
864
865
    /// Undo a previous pushUndelayed().
866
5.75M
    void popUndelayed(DelayedDiagnosticsState state) {
867
5.75M
      assert(CurPool == nullptr);
868
5.75M
      CurPool = state.SavedPool;
869
5.75M
    }
870
  } DelayedDiagnostics;
871
872
  /// A RAII object to temporarily push a declaration context.
873
  class ContextRAII {
874
  private:
875
    Sema &S;
876
    DeclContext *SavedContext;
877
    ProcessingContextState SavedContextState;
878
    QualType SavedCXXThisTypeOverride;
879
    unsigned SavedFunctionScopesStart;
880
    unsigned SavedInventedParameterInfosStart;
881
882
  public:
883
    ContextRAII(Sema &S, DeclContext *ContextToPush, bool NewThisContext = true)
884
      : S(S), SavedContext(S.CurContext),
885
        SavedContextState(S.DelayedDiagnostics.pushUndelayed()),
886
        SavedCXXThisTypeOverride(S.CXXThisTypeOverride),
887
        SavedFunctionScopesStart(S.FunctionScopesStart),
888
        SavedInventedParameterInfosStart(S.InventedParameterInfosStart)
889
5.13M
    {
890
5.13M
      assert(ContextToPush && "pushing null context");
891
5.13M
      S.CurContext = ContextToPush;
892
5.13M
      if (NewThisContext)
893
5.12M
        S.CXXThisTypeOverride = QualType();
894
      // Any saved FunctionScopes do not refer to this context.
895
5.13M
      S.FunctionScopesStart = S.FunctionScopes.size();
896
5.13M
      S.InventedParameterInfosStart = S.InventedParameterInfos.size();
897
5.13M
    }
898
899
6.03M
    void pop() {
900
6.03M
      if (!SavedContext) 
return903k
;
901
5.13M
      S.CurContext = SavedContext;
902
5.13M
      S.DelayedDiagnostics.popUndelayed(SavedContextState);
903
5.13M
      S.CXXThisTypeOverride = SavedCXXThisTypeOverride;
904
5.13M
      S.FunctionScopesStart = SavedFunctionScopesStart;
905
5.13M
      S.InventedParameterInfosStart = SavedInventedParameterInfosStart;
906
5.13M
      SavedContext = nullptr;
907
5.13M
    }
908
909
5.13M
    ~ContextRAII() {
910
5.13M
      pop();
911
5.13M
    }
912
  };
913
914
  /// Whether the AST is currently being rebuilt to correct immediate
915
  /// invocations. Immediate invocation candidates and references to consteval
916
  /// functions aren't tracked when this is set.
917
  bool RebuildingImmediateInvocation = false;
918
919
  /// Used to change context to isConstantEvaluated without pushing a heavy
920
  /// ExpressionEvaluationContextRecord object.
921
  bool isConstantEvaluatedOverride;
922
923
11.5M
  bool isConstantEvaluated() {
924
11.5M
    return ExprEvalContexts.back().isConstantEvaluated() ||
925
11.0M
           isConstantEvaluatedOverride;
926
11.5M
  }
927
928
  /// RAII object to handle the state changes required to synthesize
929
  /// a function body.
930
  class SynthesizedFunctionScope {
931
    Sema &S;
932
    Sema::ContextRAII SavedContext;
933
    bool PushedCodeSynthesisContext = false;
934
935
  public:
936
    SynthesizedFunctionScope(Sema &S, DeclContext *DC)
937
69.6k
        : S(S), SavedContext(S, DC) {
938
69.6k
      S.PushFunctionScope();
939
69.6k
      S.PushExpressionEvaluationContext(
940
69.6k
          Sema::ExpressionEvaluationContext::PotentiallyEvaluated);
941
69.6k
      if (auto *FD = dyn_cast<FunctionDecl>(DC))
942
69.5k
        FD->setWillHaveBody(true);
943
69.6k
      else
944
69.6k
        assert(isa<ObjCMethodDecl>(DC));
945
69.6k
    }
946
947
69.1k
    void addContextNote(SourceLocation UseLoc) {
948
69.1k
      assert(!PushedCodeSynthesisContext);
949
950
69.1k
      Sema::CodeSynthesisContext Ctx;
951
69.1k
      Ctx.Kind = Sema::CodeSynthesisContext::DefiningSynthesizedFunction;
952
69.1k
      Ctx.PointOfInstantiation = UseLoc;
953
69.1k
      Ctx.Entity = cast<Decl>(S.CurContext);
954
69.1k
      S.pushCodeSynthesisContext(Ctx);
955
956
69.1k
      PushedCodeSynthesisContext = true;
957
69.1k
    }
958
959
69.6k
    ~SynthesizedFunctionScope() {
960
69.6k
      if (PushedCodeSynthesisContext)
961
69.1k
        S.popCodeSynthesisContext();
962
69.6k
      if (auto *FD = dyn_cast<FunctionDecl>(S.CurContext))
963
69.5k
        FD->setWillHaveBody(false);
964
69.6k
      S.PopExpressionEvaluationContext();
965
69.6k
      S.PopFunctionScopeInfo();
966
69.6k
    }
967
  };
968
969
  /// WeakUndeclaredIdentifiers - Identifiers contained in
970
  /// \#pragma weak before declared. rare. may alias another
971
  /// identifier, declared or undeclared
972
  llvm::MapVector<IdentifierInfo *, WeakInfo> WeakUndeclaredIdentifiers;
973
974
  /// ExtnameUndeclaredIdentifiers - Identifiers contained in
975
  /// \#pragma redefine_extname before declared.  Used in Solaris system headers
976
  /// to define functions that occur in multiple standards to call the version
977
  /// in the currently selected standard.
978
  llvm::DenseMap<IdentifierInfo*,AsmLabelAttr*> ExtnameUndeclaredIdentifiers;
979
980
981
  /// Load weak undeclared identifiers from the external source.
982
  void LoadExternalWeakUndeclaredIdentifiers();
983
984
  /// WeakTopLevelDecl - Translation-unit scoped declarations generated by
985
  /// \#pragma weak during processing of other Decls.
986
  /// I couldn't figure out a clean way to generate these in-line, so
987
  /// we store them here and handle separately -- which is a hack.
988
  /// It would be best to refactor this.
989
  SmallVector<Decl*,2> WeakTopLevelDecl;
990
991
  IdentifierResolver IdResolver;
992
993
  /// Translation Unit Scope - useful to Objective-C actions that need
994
  /// to lookup file scope declarations in the "ordinary" C decl namespace.
995
  /// For example, user-defined classes, built-in "id" type, etc.
996
  Scope *TUScope;
997
998
  /// The C++ "std" namespace, where the standard library resides.
999
  LazyDeclPtr StdNamespace;
1000
1001
  /// The C++ "std::bad_alloc" class, which is defined by the C++
1002
  /// standard library.
1003
  LazyDeclPtr StdBadAlloc;
1004
1005
  /// The C++ "std::align_val_t" enum class, which is defined by the C++
1006
  /// standard library.
1007
  LazyDeclPtr StdAlignValT;
1008
1009
  /// The C++ "std::experimental" namespace, where the experimental parts
1010
  /// of the standard library resides.
1011
  NamespaceDecl *StdExperimentalNamespaceCache;
1012
1013
  /// The C++ "std::initializer_list" template, which is defined in
1014
  /// \<initializer_list>.
1015
  ClassTemplateDecl *StdInitializerList;
1016
1017
  /// The C++ "std::coroutine_traits" template, which is defined in
1018
  /// \<coroutine_traits>
1019
  ClassTemplateDecl *StdCoroutineTraitsCache;
1020
1021
  /// The C++ "type_info" declaration, which is defined in \<typeinfo>.
1022
  RecordDecl *CXXTypeInfoDecl;
1023
1024
  /// The MSVC "_GUID" struct, which is defined in MSVC header files.
1025
  RecordDecl *MSVCGuidDecl;
1026
1027
  /// Caches identifiers/selectors for NSFoundation APIs.
1028
  std::unique_ptr<NSAPI> NSAPIObj;
1029
1030
  /// The declaration of the Objective-C NSNumber class.
1031
  ObjCInterfaceDecl *NSNumberDecl;
1032
1033
  /// The declaration of the Objective-C NSValue class.
1034
  ObjCInterfaceDecl *NSValueDecl;
1035
1036
  /// Pointer to NSNumber type (NSNumber *).
1037
  QualType NSNumberPointer;
1038
1039
  /// Pointer to NSValue type (NSValue *).
1040
  QualType NSValuePointer;
1041
1042
  /// The Objective-C NSNumber methods used to create NSNumber literals.
1043
  ObjCMethodDecl *NSNumberLiteralMethods[NSAPI::NumNSNumberLiteralMethods];
1044
1045
  /// The declaration of the Objective-C NSString class.
1046
  ObjCInterfaceDecl *NSStringDecl;
1047
1048
  /// Pointer to NSString type (NSString *).
1049
  QualType NSStringPointer;
1050
1051
  /// The declaration of the stringWithUTF8String: method.
1052
  ObjCMethodDecl *StringWithUTF8StringMethod;
1053
1054
  /// The declaration of the valueWithBytes:objCType: method.
1055
  ObjCMethodDecl *ValueWithBytesObjCTypeMethod;
1056
1057
  /// The declaration of the Objective-C NSArray class.
1058
  ObjCInterfaceDecl *NSArrayDecl;
1059
1060
  /// The declaration of the arrayWithObjects:count: method.
1061
  ObjCMethodDecl *ArrayWithObjectsMethod;
1062
1063
  /// The declaration of the Objective-C NSDictionary class.
1064
  ObjCInterfaceDecl *NSDictionaryDecl;
1065
1066
  /// The declaration of the dictionaryWithObjects:forKeys:count: method.
1067
  ObjCMethodDecl *DictionaryWithObjectsMethod;
1068
1069
  /// id<NSCopying> type.
1070
  QualType QIDNSCopying;
1071
1072
  /// will hold 'respondsToSelector:'
1073
  Selector RespondsToSelectorSel;
1074
1075
  /// A flag to remember whether the implicit forms of operator new and delete
1076
  /// have been declared.
1077
  bool GlobalNewDeleteDeclared;
1078
1079
  /// A flag to indicate that we're in a context that permits abstract
1080
  /// references to fields.  This is really a
1081
  bool AllowAbstractFieldReference;
1082
1083
  /// Describes how the expressions currently being parsed are
1084
  /// evaluated at run-time, if at all.
1085
  enum class ExpressionEvaluationContext {
1086
    /// The current expression and its subexpressions occur within an
1087
    /// unevaluated operand (C++11 [expr]p7), such as the subexpression of
1088
    /// \c sizeof, where the type of the expression may be significant but
1089
    /// no code will be generated to evaluate the value of the expression at
1090
    /// run time.
1091
    Unevaluated,
1092
1093
    /// The current expression occurs within a braced-init-list within
1094
    /// an unevaluated operand. This is mostly like a regular unevaluated
1095
    /// context, except that we still instantiate constexpr functions that are
1096
    /// referenced here so that we can perform narrowing checks correctly.
1097
    UnevaluatedList,
1098
1099
    /// The current expression occurs within a discarded statement.
1100
    /// This behaves largely similarly to an unevaluated operand in preventing
1101
    /// definitions from being required, but not in other ways.
1102
    DiscardedStatement,
1103
1104
    /// The current expression occurs within an unevaluated
1105
    /// operand that unconditionally permits abstract references to
1106
    /// fields, such as a SIZE operator in MS-style inline assembly.
1107
    UnevaluatedAbstract,
1108
1109
    /// The current context is "potentially evaluated" in C++11 terms,
1110
    /// but the expression is evaluated at compile-time (like the values of
1111
    /// cases in a switch statement).
1112
    ConstantEvaluated,
1113
1114
    /// The current expression is potentially evaluated at run time,
1115
    /// which means that code may be generated to evaluate the value of the
1116
    /// expression at run time.
1117
    PotentiallyEvaluated,
1118
1119
    /// The current expression is potentially evaluated, but any
1120
    /// declarations referenced inside that expression are only used if
1121
    /// in fact the current expression is used.
1122
    ///
1123
    /// This value is used when parsing default function arguments, for which
1124
    /// we would like to provide diagnostics (e.g., passing non-POD arguments
1125
    /// through varargs) but do not want to mark declarations as "referenced"
1126
    /// until the default argument is used.
1127
    PotentiallyEvaluatedIfUsed
1128
  };
1129
1130
  using ImmediateInvocationCandidate = llvm::PointerIntPair<ConstantExpr *, 1>;
1131
1132
  /// Data structure used to record current or nested
1133
  /// expression evaluation contexts.
1134
  struct ExpressionEvaluationContextRecord {
1135
    /// The expression evaluation context.
1136
    ExpressionEvaluationContext Context;
1137
1138
    /// Whether the enclosing context needed a cleanup.
1139
    CleanupInfo ParentCleanup;
1140
1141
    /// Whether we are in a decltype expression.
1142
    bool IsDecltype;
1143
1144
    /// The number of active cleanup objects when we entered
1145
    /// this expression evaluation context.
1146
    unsigned NumCleanupObjects;
1147
1148
    /// The number of typos encountered during this expression evaluation
1149
    /// context (i.e. the number of TypoExprs created).
1150
    unsigned NumTypos;
1151
1152
    MaybeODRUseExprSet SavedMaybeODRUseExprs;
1153
1154
    /// The lambdas that are present within this context, if it
1155
    /// is indeed an unevaluated context.
1156
    SmallVector<LambdaExpr *, 2> Lambdas;
1157
1158
    /// The declaration that provides context for lambda expressions
1159
    /// and block literals if the normal declaration context does not
1160
    /// suffice, e.g., in a default function argument.
1161
    Decl *ManglingContextDecl;
1162
1163
    /// If we are processing a decltype type, a set of call expressions
1164
    /// for which we have deferred checking the completeness of the return type.
1165
    SmallVector<CallExpr *, 8> DelayedDecltypeCalls;
1166
1167
    /// If we are processing a decltype type, a set of temporary binding
1168
    /// expressions for which we have deferred checking the destructor.
1169
    SmallVector<CXXBindTemporaryExpr *, 8> DelayedDecltypeBinds;
1170
1171
    llvm::SmallPtrSet<const Expr *, 8> PossibleDerefs;
1172
1173
    /// Expressions appearing as the LHS of a volatile assignment in this
1174
    /// context. We produce a warning for these when popping the context if
1175
    /// they are not discarded-value expressions nor unevaluated operands.
1176
    SmallVector<Expr*, 2> VolatileAssignmentLHSs;
1177
1178
    /// Set of candidates for starting an immediate invocation.
1179
    llvm::SmallVector<ImmediateInvocationCandidate, 4> ImmediateInvocationCandidates;
1180
1181
    /// Set of DeclRefExprs referencing a consteval function when used in a
1182
    /// context not already known to be immediately invoked.
1183
    llvm::SmallPtrSet<DeclRefExpr *, 4> ReferenceToConsteval;
1184
1185
    /// \brief Describes whether we are in an expression constext which we have
1186
    /// to handle differently.
1187
    enum ExpressionKind {
1188
      EK_Decltype, EK_TemplateArgument, EK_Other
1189
    } ExprContext;
1190
1191
    ExpressionEvaluationContextRecord(ExpressionEvaluationContext Context,
1192
                                      unsigned NumCleanupObjects,
1193
                                      CleanupInfo ParentCleanup,
1194
                                      Decl *ManglingContextDecl,
1195
                                      ExpressionKind ExprContext)
1196
        : Context(Context), ParentCleanup(ParentCleanup),
1197
          NumCleanupObjects(NumCleanupObjects), NumTypos(0),
1198
38.9M
          ManglingContextDecl(ManglingContextDecl), ExprContext(ExprContext) {}
1199
1200
87.2M
    bool isUnevaluated() const {
1201
87.2M
      return Context == ExpressionEvaluationContext::Unevaluated ||
1202
71.5M
             Context == ExpressionEvaluationContext::UnevaluatedAbstract ||
1203
71.5M
             Context == ExpressionEvaluationContext::UnevaluatedList;
1204
87.2M
    }
1205
34.9M
    bool isConstantEvaluated() const {
1206
34.9M
      return Context == ExpressionEvaluationContext::ConstantEvaluated;
1207
34.9M
    }
1208
  };
1209
1210
  /// A stack of expression evaluation contexts.
1211
  SmallVector<ExpressionEvaluationContextRecord, 8> ExprEvalContexts;
1212
1213
  /// Emit a warning for all pending noderef expressions that we recorded.
1214
  void WarnOnPendingNoDerefs(ExpressionEvaluationContextRecord &Rec);
1215
1216
  /// Compute the mangling number context for a lambda expression or
1217
  /// block literal. Also return the extra mangling decl if any.
1218
  ///
1219
  /// \param DC - The DeclContext containing the lambda expression or
1220
  /// block literal.
1221
  std::tuple<MangleNumberingContext *, Decl *>
1222
  getCurrentMangleNumberContext(const DeclContext *DC);
1223
1224
1225
  /// SpecialMemberOverloadResult - The overloading result for a special member
1226
  /// function.
1227
  ///
1228
  /// This is basically a wrapper around PointerIntPair. The lowest bits of the
1229
  /// integer are used to determine whether overload resolution succeeded.
1230
  class SpecialMemberOverloadResult {
1231
  public:
1232
    enum Kind {
1233
      NoMemberOrDeleted,
1234
      Ambiguous,
1235
      Success
1236
    };
1237
1238
  private:
1239
    llvm::PointerIntPair<CXXMethodDecl*, 2> Pair;
1240
1241
  public:
1242
406k
    SpecialMemberOverloadResult() : Pair() {}
1243
    SpecialMemberOverloadResult(CXXMethodDecl *MD)
1244
991
        : Pair(MD, MD->isDeleted() ? NoMemberOrDeleted : Success) {}
1245
1246
1.05M
    CXXMethodDecl *getMethod() const { return Pair.getPointer(); }
1247
235k
    void setMethod(CXXMethodDecl *MD) { Pair.setPointer(MD); }
1248
1249
546k
    Kind getKind() const { return static_cast<Kind>(Pair.getInt()); }
1250
235k
    void setKind(Kind K) { Pair.setInt(K); }
1251
  };
1252
1253
  class SpecialMemberOverloadResultEntry
1254
      : public llvm::FastFoldingSetNode,
1255
        public SpecialMemberOverloadResult {
1256
  public:
1257
    SpecialMemberOverloadResultEntry(const llvm::FoldingSetNodeID &ID)
1258
      : FastFoldingSetNode(ID)
1259
235k
    {}
1260
  };
1261
1262
  /// A cache of special member function overload resolution results
1263
  /// for C++ records.
1264
  llvm::FoldingSet<SpecialMemberOverloadResultEntry> SpecialMemberCache;
1265
1266
  /// A cache of the flags available in enumerations with the flag_bits
1267
  /// attribute.
1268
  mutable llvm::DenseMap<const EnumDecl*, llvm::APInt> FlagBitsCache;
1269
1270
  /// The kind of translation unit we are processing.
1271
  ///
1272
  /// When we're processing a complete translation unit, Sema will perform
1273
  /// end-of-translation-unit semantic tasks (such as creating
1274
  /// initializers for tentative definitions in C) once parsing has
1275
  /// completed. Modules and precompiled headers perform different kinds of
1276
  /// checks.
1277
  TranslationUnitKind TUKind;
1278
1279
  llvm::BumpPtrAllocator BumpAlloc;
1280
1281
  /// The number of SFINAE diagnostics that have been trapped.
1282
  unsigned NumSFINAEErrors;
1283
1284
  typedef llvm::DenseMap<ParmVarDecl *, llvm::TinyPtrVector<ParmVarDecl *>>
1285
    UnparsedDefaultArgInstantiationsMap;
1286
1287
  /// A mapping from parameters with unparsed default arguments to the
1288
  /// set of instantiations of each parameter.
1289
  ///
1290
  /// This mapping is a temporary data structure used when parsing
1291
  /// nested class templates or nested classes of class templates,
1292
  /// where we might end up instantiating an inner class before the
1293
  /// default arguments of its methods have been parsed.
1294
  UnparsedDefaultArgInstantiationsMap UnparsedDefaultArgInstantiations;
1295
1296
  // Contains the locations of the beginning of unparsed default
1297
  // argument locations.
1298
  llvm::DenseMap<ParmVarDecl *, SourceLocation> UnparsedDefaultArgLocs;
1299
1300
  /// UndefinedInternals - all the used, undefined objects which require a
1301
  /// definition in this translation unit.
1302
  llvm::MapVector<NamedDecl *, SourceLocation> UndefinedButUsed;
1303
1304
  /// Determine if VD, which must be a variable or function, is an external
1305
  /// symbol that nonetheless can't be referenced from outside this translation
1306
  /// unit because its type has no linkage and it's not extern "C".
1307
  bool isExternalWithNoLinkageType(ValueDecl *VD);
1308
1309
  /// Obtain a sorted list of functions that are undefined but ODR-used.
1310
  void getUndefinedButUsed(
1311
      SmallVectorImpl<std::pair<NamedDecl *, SourceLocation> > &Undefined);
1312
1313
  /// Retrieves list of suspicious delete-expressions that will be checked at
1314
  /// the end of translation unit.
1315
  const llvm::MapVector<FieldDecl *, DeleteLocs> &
1316
  getMismatchingDeleteExpressions() const;
1317
1318
  typedef std::pair<ObjCMethodList, ObjCMethodList> GlobalMethods;
1319
  typedef llvm::DenseMap<Selector, GlobalMethods> GlobalMethodPool;
1320
1321
  /// Method Pool - allows efficient lookup when typechecking messages to "id".
1322
  /// We need to maintain a list, since selectors can have differing signatures
1323
  /// across classes. In Cocoa, this happens to be extremely uncommon (only 1%
1324
  /// of selectors are "overloaded").
1325
  /// At the head of the list it is recorded whether there were 0, 1, or >= 2
1326
  /// methods inside categories with a particular selector.
1327
  GlobalMethodPool MethodPool;
1328
1329
  /// Method selectors used in a \@selector expression. Used for implementation
1330
  /// of -Wselector.
1331
  llvm::MapVector<Selector, SourceLocation> ReferencedSelectors;
1332
1333
  /// List of SourceLocations where 'self' is implicitly retained inside a
1334
  /// block.
1335
  llvm::SmallVector<std::pair<SourceLocation, const BlockDecl *>, 1>
1336
      ImplicitlyRetainedSelfLocs;
1337
1338
  /// Kinds of C++ special members.
1339
  enum CXXSpecialMember {
1340
    CXXDefaultConstructor,
1341
    CXXCopyConstructor,
1342
    CXXMoveConstructor,
1343
    CXXCopyAssignment,
1344
    CXXMoveAssignment,
1345
    CXXDestructor,
1346
    CXXInvalid
1347
  };
1348
1349
  typedef llvm::PointerIntPair<CXXRecordDecl *, 3, CXXSpecialMember>
1350
      SpecialMemberDecl;
1351
1352
  /// The C++ special members which we are currently in the process of
1353
  /// declaring. If this process recursively triggers the declaration of the
1354
  /// same special member, we should act as if it is not yet declared.
1355
  llvm::SmallPtrSet<SpecialMemberDecl, 4> SpecialMembersBeingDeclared;
1356
1357
  /// Kinds of defaulted comparison operator functions.
1358
  enum class DefaultedComparisonKind : unsigned char {
1359
    /// This is not a defaultable comparison operator.
1360
    None,
1361
    /// This is an operator== that should be implemented as a series of
1362
    /// subobject comparisons.
1363
    Equal,
1364
    /// This is an operator<=> that should be implemented as a series of
1365
    /// subobject comparisons.
1366
    ThreeWay,
1367
    /// This is an operator!= that should be implemented as a rewrite in terms
1368
    /// of a == comparison.
1369
    NotEqual,
1370
    /// This is an <, <=, >, or >= that should be implemented as a rewrite in
1371
    /// terms of a <=> comparison.
1372
    Relational,
1373
  };
1374
1375
  /// The function definitions which were renamed as part of typo-correction
1376
  /// to match their respective declarations. We want to keep track of them
1377
  /// to ensure that we don't emit a "redefinition" error if we encounter a
1378
  /// correctly named definition after the renamed definition.
1379
  llvm::SmallPtrSet<const NamedDecl *, 4> TypoCorrectedFunctionDefinitions;
1380
1381
  /// Stack of types that correspond to the parameter entities that are
1382
  /// currently being copy-initialized. Can be empty.
1383
  llvm::SmallVector<QualType, 4> CurrentParameterCopyTypes;
1384
1385
  void ReadMethodPool(Selector Sel);
1386
  void updateOutOfDateSelector(Selector Sel);
1387
1388
  /// Private Helper predicate to check for 'self'.
1389
  bool isSelfExpr(Expr *RExpr);
1390
  bool isSelfExpr(Expr *RExpr, const ObjCMethodDecl *Method);
1391
1392
  /// Cause the active diagnostic on the DiagosticsEngine to be
1393
  /// emitted. This is closely coupled to the SemaDiagnosticBuilder class and
1394
  /// should not be used elsewhere.
1395
  void EmitCurrentDiagnostic(unsigned DiagID);
1396
1397
  /// Records and restores the CurFPFeatures state on entry/exit of compound
1398
  /// statements.
1399
  class FPFeaturesStateRAII {
1400
  public:
1401
5.39M
    FPFeaturesStateRAII(Sema &S) : S(S), OldFPFeaturesState(S.CurFPFeatures) {
1402
5.39M
      OldOverrides = S.FpPragmaStack.CurrentValue;
1403
5.39M
    }
1404
5.39M
    ~FPFeaturesStateRAII() {
1405
5.39M
      S.CurFPFeatures = OldFPFeaturesState;
1406
5.39M
      S.FpPragmaStack.CurrentValue = OldOverrides;
1407
5.39M
    }
1408
0
    FPOptionsOverride getOverrides() { return OldOverrides; }
1409
1410
  private:
1411
    Sema& S;
1412
    FPOptions OldFPFeaturesState;
1413
    FPOptionsOverride OldOverrides;
1414
  };
1415
1416
  void addImplicitTypedef(StringRef Name, QualType T);
1417
1418
  bool WarnedStackExhausted = false;
1419
1420
public:
1421
  Sema(Preprocessor &pp, ASTContext &ctxt, ASTConsumer &consumer,
1422
       TranslationUnitKind TUKind = TU_Complete,
1423
       CodeCompleteConsumer *CompletionConsumer = nullptr);
1424
  ~Sema();
1425
1426
  /// Perform initialization that occurs after the parser has been
1427
  /// initialized but before it parses anything.
1428
  void Initialize();
1429
1430
2.88G
  const LangOptions &getLangOpts() const { return LangOpts; }
1431
115k
  OpenCLOptions &getOpenCLOptions() { return OpenCLFeatures; }
1432
3.73M
  FPOptions     &getCurFPFeatures() { return CurFPFeatures; }
1433
1434
29.5M
  DiagnosticsEngine &getDiagnostics() const { return Diags; }
1435
1.83M
  SourceManager &getSourceManager() const { return SourceMgr; }
1436
226k
  Preprocessor &getPreprocessor() const { return PP; }
1437
105M
  ASTContext &getASTContext() const { return Context; }
1438
848k
  ASTConsumer &getASTConsumer() const { return Consumer; }
1439
  ASTMutationListener *getASTMutationListener() const;
1440
701k
  ExternalSemaSource* getExternalSource() const { return ExternalSource; }
1441
1442
  ///Registers an external source. If an external source already exists,
1443
  /// creates a multiplex external source and appends to it.
1444
  ///
1445
  ///\param[in] E - A non-null external sema source.
1446
  ///
1447
  void addExternalSource(ExternalSemaSource *E);
1448
1449
  void PrintStats() const;
1450
1451
  /// Warn that the stack is nearly exhausted.
1452
  void warnStackExhausted(SourceLocation Loc);
1453
1454
  /// Run some code with "sufficient" stack space. (Currently, at least 256K is
1455
  /// guaranteed). Produces a warning if we're low on stack space and allocates
1456
  /// more in that case. Use this in code that may recurse deeply (for example,
1457
  /// in template instantiation) to avoid stack overflow.
1458
  void runWithSufficientStackSpace(SourceLocation Loc,
1459
                                   llvm::function_ref<void()> Fn);
1460
1461
  /// Helper class that creates diagnostics with optional
1462
  /// template instantiation stacks.
1463
  ///
1464
  /// This class provides a wrapper around the basic DiagnosticBuilder
1465
  /// class that emits diagnostics. SemaDiagnosticBuilder is
1466
  /// responsible for emitting the diagnostic (as DiagnosticBuilder
1467
  /// does) and, if the diagnostic comes from inside a template
1468
  /// instantiation, printing the template instantiation stack as
1469
  /// well.
1470
  class SemaDiagnosticBuilder : public DiagnosticBuilder {
1471
    Sema &SemaRef;
1472
    unsigned DiagID;
1473
1474
  public:
1475
    SemaDiagnosticBuilder(DiagnosticBuilder &DB, Sema &SemaRef, unsigned DiagID)
1476
2.68M
      : DiagnosticBuilder(DB), SemaRef(SemaRef), DiagID(DiagID) { }
1477
1478
    // This is a cunning lie. DiagnosticBuilder actually performs move
1479
    // construction in its copy constructor (but due to varied uses, it's not
1480
    // possible to conveniently express this as actual move construction). So
1481
    // the default copy ctor here is fine, because the base class disables the
1482
    // source anyway, so the user-defined ~SemaDiagnosticBuilder is a safe no-op
1483
    // in that case anwyay.
1484
5.50k
    SemaDiagnosticBuilder(const SemaDiagnosticBuilder&) = default;
1485
1486
2.69M
    ~SemaDiagnosticBuilder() {
1487
      // If we aren't active, there is nothing to do.
1488
2.69M
      if (!isActive()) 
return6.55k
;
1489
1490
      // Otherwise, we need to emit the diagnostic. First flush the underlying
1491
      // DiagnosticBuilder data, and clear the diagnostic builder itself so it
1492
      // won't emit the diagnostic in its own destructor.
1493
      //
1494
      // This seems wasteful, in that as written the DiagnosticBuilder dtor will
1495
      // do its own needless checks to see if the diagnostic needs to be
1496
      // emitted. However, because we take care to ensure that the builder
1497
      // objects never escape, a sufficiently smart compiler will be able to
1498
      // eliminate that code.
1499
2.68M
      FlushCounts();
1500
2.68M
      Clear();
1501
1502
      // Dispatch to Sema to emit the diagnostic.
1503
2.68M
      SemaRef.EmitCurrentDiagnostic(DiagID);
1504
2.68M
    }
1505
1506
    /// Teach operator<< to produce an object of the correct type.
1507
    template<typename T>
1508
    friend const SemaDiagnosticBuilder &operator<<(
1509
3.03M
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
3.03M
      const DiagnosticBuilder &BaseDiag = Diag;
1511
3.03M
      BaseDiag << Value;
1512
3.03M
      return Diag;
1513
3.03M
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<llvm::SmallString<32u> >(clang::Sema::SemaDiagnosticBuilder const&, llvm::SmallString<32u> const&)
Line
Count
Source
1509
386
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
386
      const DiagnosticBuilder &BaseDiag = Diag;
1511
386
      BaseDiag << Value;
1512
386
      return Diag;
1513
386
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [17]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [17])
Line
Count
Source
1509
30
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
30
      const DiagnosticBuilder &BaseDiag = Diag;
1511
30
      BaseDiag << Value;
1512
30
      return Diag;
1513
30
    }
Unexecuted instantiation: clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [46]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [46])
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [36]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [36])
Line
Count
Source
1509
16
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
16
      const DiagnosticBuilder &BaseDiag = Diag;
1511
16
      BaseDiag << Value;
1512
16
      return Diag;
1513
16
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [45]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [45])
Line
Count
Source
1509
90
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
90
      const DiagnosticBuilder &BaseDiag = Diag;
1511
90
      BaseDiag << Value;
1512
90
      return Diag;
1513
90
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [31]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [31])
Line
Count
Source
1509
12
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
12
      const DiagnosticBuilder &BaseDiag = Diag;
1511
12
      BaseDiag << Value;
1512
12
      return Diag;
1513
12
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [23]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [23])
Line
Count
Source
1509
33
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
33
      const DiagnosticBuilder &BaseDiag = Diag;
1511
33
      BaseDiag << Value;
1512
33
      return Diag;
1513
33
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [24]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [24])
Line
Count
Source
1509
9
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
9
      const DiagnosticBuilder &BaseDiag = Diag;
1511
9
      BaseDiag << Value;
1512
9
      return Diag;
1513
9
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [32]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [32])
Line
Count
Source
1509
3
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
3
      const DiagnosticBuilder &BaseDiag = Diag;
1511
3
      BaseDiag << Value;
1512
3
      return Diag;
1513
3
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [34]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [34])
Line
Count
Source
1509
37
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
37
      const DiagnosticBuilder &BaseDiag = Diag;
1511
37
      BaseDiag << Value;
1512
37
      return Diag;
1513
37
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [19]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [19])
Line
Count
Source
1509
88
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
88
      const DiagnosticBuilder &BaseDiag = Diag;
1511
88
      BaseDiag << Value;
1512
88
      return Diag;
1513
88
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [29]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [29])
Line
Count
Source
1509
62
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
62
      const DiagnosticBuilder &BaseDiag = Diag;
1511
62
      BaseDiag << Value;
1512
62
      return Diag;
1513
62
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [11]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [11])
Line
Count
Source
1509
26
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
26
      const DiagnosticBuilder &BaseDiag = Diag;
1511
26
      BaseDiag << Value;
1512
26
      return Diag;
1513
26
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [8]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [8])
Line
Count
Source
1509
89
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
89
      const DiagnosticBuilder &BaseDiag = Diag;
1511
89
      BaseDiag << Value;
1512
89
      return Diag;
1513
89
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [54]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [54])
Line
Count
Source
1509
3
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
3
      const DiagnosticBuilder &BaseDiag = Diag;
1511
3
      BaseDiag << Value;
1512
3
      return Diag;
1513
3
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [39]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [39])
Line
Count
Source
1509
4
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
4
      const DiagnosticBuilder &BaseDiag = Diag;
1511
4
      BaseDiag << Value;
1512
4
      return Diag;
1513
4
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [47]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [47])
Line
Count
Source
1509
5
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
5
      const DiagnosticBuilder &BaseDiag = Diag;
1511
5
      BaseDiag << Value;
1512
5
      return Diag;
1513
5
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [16]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [16])
Line
Count
Source
1509
21
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
21
      const DiagnosticBuilder &BaseDiag = Diag;
1511
21
      BaseDiag << Value;
1512
21
      return Diag;
1513
21
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [22]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [22])
Line
Count
Source
1509
7
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
7
      const DiagnosticBuilder &BaseDiag = Diag;
1511
7
      BaseDiag << Value;
1512
7
      return Diag;
1513
7
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [58]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [58])
Line
Count
Source
1509
150
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
150
      const DiagnosticBuilder &BaseDiag = Diag;
1511
150
      BaseDiag << Value;
1512
150
      return Diag;
1513
150
    }
Unexecuted instantiation: clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [59]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [59])
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [6]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [6])
Line
Count
Source
1509
7.08k
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
7.08k
      const DiagnosticBuilder &BaseDiag = Diag;
1511
7.08k
      BaseDiag << Value;
1512
7.08k
      return Diag;
1513
7.08k
    }
Unexecuted instantiation: clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [57]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [57])
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [48]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [48])
Line
Count
Source
1509
3
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
3
      const DiagnosticBuilder &BaseDiag = Diag;
1511
3
      BaseDiag << Value;
1512
3
      return Diag;
1513
3
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [42]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [42])
Line
Count
Source
1509
1
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
1
      const DiagnosticBuilder &BaseDiag = Diag;
1511
1
      BaseDiag << Value;
1512
1
      return Diag;
1513
1
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [43]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [43])
Line
Count
Source
1509
1
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
1
      const DiagnosticBuilder &BaseDiag = Diag;
1511
1
      BaseDiag << Value;
1512
1
      return Diag;
1513
1
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [56]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [56])
Line
Count
Source
1509
17
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
17
      const DiagnosticBuilder &BaseDiag = Diag;
1511
17
      BaseDiag << Value;
1512
17
      return Diag;
1513
17
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [20]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [20])
Line
Count
Source
1509
1
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
1
      const DiagnosticBuilder &BaseDiag = Diag;
1511
1
      BaseDiag << Value;
1512
1
      return Diag;
1513
1
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [75]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [75])
Line
Count
Source
1509
1
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
1
      const DiagnosticBuilder &BaseDiag = Diag;
1511
1
      BaseDiag << Value;
1512
1
      return Diag;
1513
1
    }
Unexecuted instantiation: clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [53]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [53])
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [38]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [38])
Line
Count
Source
1509
12
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
12
      const DiagnosticBuilder &BaseDiag = Diag;
1511
12
      BaseDiag << Value;
1512
12
      return Diag;
1513
12
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [35]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [35])
Line
Count
Source
1509
2
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
2
      const DiagnosticBuilder &BaseDiag = Diag;
1511
2
      BaseDiag << Value;
1512
2
      return Diag;
1513
2
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [28]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [28])
Line
Count
Source
1509
2
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
2
      const DiagnosticBuilder &BaseDiag = Diag;
1511
2
      BaseDiag << Value;
1512
2
      return Diag;
1513
2
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [71]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [71])
Line
Count
Source
1509
5
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
5
      const DiagnosticBuilder &BaseDiag = Diag;
1511
5
      BaseDiag << Value;
1512
5
      return Diag;
1513
5
    }
Unexecuted instantiation: clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [92]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [92])
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [67]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [67])
Line
Count
Source
1509
3
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
3
      const DiagnosticBuilder &BaseDiag = Diag;
1511
3
      BaseDiag << Value;
1512
3
      return Diag;
1513
3
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [49]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [49])
Line
Count
Source
1509
5
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
5
      const DiagnosticBuilder &BaseDiag = Diag;
1511
5
      BaseDiag << Value;
1512
5
      return Diag;
1513
5
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [25]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [25])
Line
Count
Source
1509
1
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
1
      const DiagnosticBuilder &BaseDiag = Diag;
1511
1
      BaseDiag << Value;
1512
1
      return Diag;
1513
1
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [77]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [77])
Line
Count
Source
1509
4
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
4
      const DiagnosticBuilder &BaseDiag = Diag;
1511
4
      BaseDiag << Value;
1512
4
      return Diag;
1513
4
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [150]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [150])
Line
Count
Source
1509
1
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
1
      const DiagnosticBuilder &BaseDiag = Diag;
1511
1
      BaseDiag << Value;
1512
1
      return Diag;
1513
1
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [69]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [69])
Line
Count
Source
1509
2
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
2
      const DiagnosticBuilder &BaseDiag = Diag;
1511
2
      BaseDiag << Value;
1512
2
      return Diag;
1513
2
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [87]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [87])
Line
Count
Source
1509
3
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
3
      const DiagnosticBuilder &BaseDiag = Diag;
1511
3
      BaseDiag << Value;
1512
3
      return Diag;
1513
3
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::ValueDecl*>(clang::Sema::SemaDiagnosticBuilder const&, clang::ValueDecl* const&)
Line
Count
Source
1509
8.69k
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
8.69k
      const DiagnosticBuilder &BaseDiag = Diag;
1511
8.69k
      BaseDiag << Value;
1512
8.69k
      return Diag;
1513
8.69k
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(clang::Sema::SemaDiagnosticBuilder const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
Line
Count
Source
1509
84.3k
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
84.3k
      const DiagnosticBuilder &BaseDiag = Diag;
1511
84.3k
      BaseDiag << Value;
1512
84.3k
      return Diag;
1513
84.3k
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<unsigned int>(clang::Sema::SemaDiagnosticBuilder const&, unsigned int const&)
Line
Count
Source
1509
79.0k
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
79.0k
      const DiagnosticBuilder &BaseDiag = Diag;
1511
79.0k
      BaseDiag << Value;
1512
79.0k
      return Diag;
1513
79.0k
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::ValueDecl const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::ValueDecl const* const&)
Line
Count
Source
1509
11.1k
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
11.1k
      const DiagnosticBuilder &BaseDiag = Diag;
1511
11.1k
      BaseDiag << Value;
1512
11.1k
      return Diag;
1513
11.1k
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::QualType>(clang::Sema::SemaDiagnosticBuilder const&, clang::QualType const&)
Line
Count
Source
1509
347k
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
347k
      const DiagnosticBuilder &BaseDiag = Diag;
1511
347k
      BaseDiag << Value;
1512
347k
      return Diag;
1513
347k
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::FixItHint>(clang::Sema::SemaDiagnosticBuilder const&, clang::FixItHint const&)
Line
Count
Source
1509
213k
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
213k
      const DiagnosticBuilder &BaseDiag = Diag;
1511
213k
      BaseDiag << Value;
1512
213k
      return Diag;
1513
213k
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<bool>(clang::Sema::SemaDiagnosticBuilder const&, bool const&)
Line
Count
Source
1509
98.4k
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
98.4k
      const DiagnosticBuilder &BaseDiag = Diag;
1511
98.4k
      BaseDiag << Value;
1512
98.4k
      return Diag;
1513
98.4k
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::DeclarationName>(clang::Sema::SemaDiagnosticBuilder const&, clang::DeclarationName const&)
Line
Count
Source
1509
86.0k
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
86.0k
      const DiagnosticBuilder &BaseDiag = Diag;
1511
86.0k
      BaseDiag << Value;
1512
86.0k
      return Diag;
1513
86.0k
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [7]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [7])
Line
Count
Source
1509
250
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
250
      const DiagnosticBuilder &BaseDiag = Diag;
1511
250
      BaseDiag << Value;
1512
250
      return Diag;
1513
250
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::AttributeDeclKind>(clang::Sema::SemaDiagnosticBuilder const&, clang::AttributeDeclKind const&)
Line
Count
Source
1509
68
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
68
      const DiagnosticBuilder &BaseDiag = Diag;
1511
68
      BaseDiag << Value;
1512
68
      return Diag;
1513
68
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::IdentifierInfo*>(clang::Sema::SemaDiagnosticBuilder const&, clang::IdentifierInfo* const&)
Line
Count
Source
1509
79.7k
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
79.7k
      const DiagnosticBuilder &BaseDiag = Diag;
1511
79.7k
      BaseDiag << Value;
1512
79.7k
      return Diag;
1513
79.7k
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::FunctionDecl const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::FunctionDecl const* const&)
Line
Count
Source
1509
23.0k
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
23.0k
      const DiagnosticBuilder &BaseDiag = Diag;
1511
23.0k
      BaseDiag << Value;
1512
23.0k
      return Diag;
1513
23.0k
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<int>(clang::Sema::SemaDiagnosticBuilder const&, int const&)
Line
Count
Source
1509
220k
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
220k
      const DiagnosticBuilder &BaseDiag = Diag;
1511
220k
      BaseDiag << Value;
1512
220k
      return Diag;
1513
220k
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::VarDecl const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::VarDecl const* const&)
Line
Count
Source
1509
1.65k
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
1.65k
      const DiagnosticBuilder &BaseDiag = Diag;
1511
1.65k
      BaseDiag << Value;
1512
1.65k
      return Diag;
1513
1.65k
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::SourceRange>(clang::Sema::SemaDiagnosticBuilder const&, clang::SourceRange const&)
Line
Count
Source
1509
1.04M
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
1.04M
      const DiagnosticBuilder &BaseDiag = Diag;
1511
1.04M
      BaseDiag << Value;
1512
1.04M
      return Diag;
1513
1.04M
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [12]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [12])
Line
Count
Source
1509
230
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
230
      const DiagnosticBuilder &BaseDiag = Diag;
1511
230
      BaseDiag << Value;
1512
230
      return Diag;
1513
230
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [5]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [5])
Line
Count
Source
1509
116
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
116
      const DiagnosticBuilder &BaseDiag = Diag;
1511
116
      BaseDiag << Value;
1512
116
      return Diag;
1513
116
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [14]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [14])
Line
Count
Source
1509
31
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
31
      const DiagnosticBuilder &BaseDiag = Diag;
1511
31
      BaseDiag << Value;
1512
31
      return Diag;
1513
31
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [9]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [9])
Line
Count
Source
1509
18.4k
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
18.4k
      const DiagnosticBuilder &BaseDiag = Diag;
1511
18.4k
      BaseDiag << Value;
1512
18.4k
      return Diag;
1513
18.4k
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::DeclaratorDecl*>(clang::Sema::SemaDiagnosticBuilder const&, clang::DeclaratorDecl* const&)
Line
Count
Source
1509
4
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
4
      const DiagnosticBuilder &BaseDiag = Diag;
1511
4
      BaseDiag << Value;
1512
4
      return Diag;
1513
4
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::ASTContext::SectionInfo>(clang::Sema::SemaDiagnosticBuilder const&, clang::ASTContext::SectionInfo const&)
Line
Count
Source
1509
11
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
11
      const DiagnosticBuilder &BaseDiag = Diag;
1511
11
      BaseDiag << Value;
1512
11
      return Diag;
1513
11
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<llvm::StringRef>(clang::Sema::SemaDiagnosticBuilder const&, llvm::StringRef const&)
Line
Count
Source
1509
106k
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
106k
      const DiagnosticBuilder &BaseDiag = Diag;
1511
106k
      BaseDiag << Value;
1512
106k
      return Diag;
1513
106k
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char const*>(clang::Sema::SemaDiagnosticBuilder const&, char const* const&)
Line
Count
Source
1509
5.21k
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
5.21k
      const DiagnosticBuilder &BaseDiag = Diag;
1511
5.21k
      BaseDiag << Value;
1512
5.21k
      return Diag;
1513
5.21k
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::ParsedAttr>(clang::Sema::SemaDiagnosticBuilder const&, clang::ParsedAttr const&)
Line
Count
Source
1509
10.5k
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
10.5k
      const DiagnosticBuilder &BaseDiag = Diag;
1511
10.5k
      BaseDiag << Value;
1512
10.5k
      return Diag;
1513
10.5k
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::IdentifierInfo const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::IdentifierInfo const* const&)
Line
Count
Source
1509
374
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
374
      const DiagnosticBuilder &BaseDiag = Diag;
1511
374
      BaseDiag << Value;
1512
374
      return Diag;
1513
374
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<llvm::SmallVector<clang::FixItHint, 12u> >(clang::Sema::SemaDiagnosticBuilder const&, llvm::SmallVector<clang::FixItHint, 12u> const&)
Line
Count
Source
1509
41.1k
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
41.1k
      const DiagnosticBuilder &BaseDiag = Diag;
1511
41.1k
      BaseDiag << Value;
1512
41.1k
      return Diag;
1513
41.1k
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<CastType>(clang::Sema::SemaDiagnosticBuilder const&, CastType const&)
Line
Count
Source
1509
449
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
449
      const DiagnosticBuilder &BaseDiag = Diag;
1511
449
      BaseDiag << Value;
1512
449
      return Diag;
1513
449
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [37]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [37])
Line
Count
Source
1509
4
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
4
      const DiagnosticBuilder &BaseDiag = Diag;
1511
4
      BaseDiag << Value;
1512
4
      return Diag;
1513
4
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<llvm::SmallString<16u> >(clang::Sema::SemaDiagnosticBuilder const&, llvm::SmallString<16u> const&)
Line
Count
Source
1509
201
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
201
      const DiagnosticBuilder &BaseDiag = Diag;
1511
201
      BaseDiag << Value;
1512
201
      return Diag;
1513
201
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<llvm::ArrayRef<clang::FixItHint> >(clang::Sema::SemaDiagnosticBuilder const&, llvm::ArrayRef<clang::FixItHint> const&)
Line
Count
Source
1509
5.43k
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
5.43k
      const DiagnosticBuilder &BaseDiag = Diag;
1511
5.43k
      BaseDiag << Value;
1512
5.43k
      return Diag;
1513
5.43k
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::CharSourceRange>(clang::Sema::SemaDiagnosticBuilder const&, clang::CharSourceRange const&)
Line
Count
Source
1509
5.33k
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
5.33k
      const DiagnosticBuilder &BaseDiag = Diag;
1511
5.33k
      BaseDiag << Value;
1512
5.33k
      return Diag;
1513
5.33k
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<AbsoluteValueKind>(clang::Sema::SemaDiagnosticBuilder const&, AbsoluteValueKind const&)
Line
Count
Source
1509
768
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
768
      const DiagnosticBuilder &BaseDiag = Diag;
1511
768
      BaseDiag << Value;
1512
768
      return Diag;
1513
768
    }
SemaChecking.cpp:clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::Sema::DiagnoseAlwaysNonNullPointer(clang::Expr*, clang::Expr::NullPointerConstantKind, bool, clang::SourceRange)::$_9>(clang::Sema::SemaDiagnosticBuilder const&, clang::Sema::DiagnoseAlwaysNonNullPointer(clang::Expr*, clang::Expr::NullPointerConstantKind, bool, clang::SourceRange)::$_9 const&)
Line
Count
Source
1509
232
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
232
      const DiagnosticBuilder &BaseDiag = Diag;
1511
232
      BaseDiag << Value;
1512
232
      return Diag;
1513
232
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::ConceptSpecializationExpr*>(clang::Sema::SemaDiagnosticBuilder const&, clang::ConceptSpecializationExpr* const&)
Line
Count
Source
1509
34
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
34
      const DiagnosticBuilder &BaseDiag = Diag;
1511
34
      BaseDiag << Value;
1512
34
      return Diag;
1513
34
    }
SemaCoroutine.cpp:clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<isValidCoroutineContext(clang::Sema&, clang::SourceLocation, llvm::StringRef)::InvalidFuncDiag>(clang::Sema::SemaDiagnosticBuilder const&, isValidCoroutineContext(clang::Sema&, clang::SourceLocation, llvm::StringRef)::InvalidFuncDiag const&)
Line
Count
Source
1509
9
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
9
      const DiagnosticBuilder &BaseDiag = Diag;
1511
9
      BaseDiag << Value;
1512
9
      return Diag;
1513
9
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::LabelDecl*>(clang::Sema::SemaDiagnosticBuilder const&, clang::LabelDecl* const&)
Line
Count
Source
1509
358
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
358
      const DiagnosticBuilder &BaseDiag = Diag;
1511
358
      BaseDiag << Value;
1512
358
      return Diag;
1513
358
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::AlignedAttr const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::AlignedAttr const* const&)
Line
Count
Source
1509
8
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
8
      const DiagnosticBuilder &BaseDiag = Diag;
1511
8
      BaseDiag << Value;
1512
8
      return Diag;
1513
8
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::AlignedAttr*>(clang::Sema::SemaDiagnosticBuilder const&, clang::AlignedAttr* const&)
Line
Count
Source
1509
44
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
44
      const DiagnosticBuilder &BaseDiag = Diag;
1511
44
      BaseDiag << Value;
1512
44
      return Diag;
1513
44
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::Attr const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::Attr const* const&)
Line
Count
Source
1509
457
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
457
      const DiagnosticBuilder &BaseDiag = Diag;
1511
457
      BaseDiag << Value;
1512
457
      return Diag;
1513
457
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::DLLImportAttr const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::DLLImportAttr const* const&)
Line
Count
Source
1509
409
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
409
      const DiagnosticBuilder &BaseDiag = Diag;
1511
409
      BaseDiag << Value;
1512
409
      return Diag;
1513
409
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::SourceLocation>(clang::Sema::SemaDiagnosticBuilder const&, clang::SourceLocation const&)
Line
Count
Source
1509
1.21k
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
1.21k
      const DiagnosticBuilder &BaseDiag = Diag;
1511
1.21k
      BaseDiag << Value;
1512
1.21k
      return Diag;
1513
1.21k
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::NotTailCalledAttr*>(clang::Sema::SemaDiagnosticBuilder const&, clang::NotTailCalledAttr* const&)
Line
Count
Source
1509
2
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
2
      const DiagnosticBuilder &BaseDiag = Diag;
1511
2
      BaseDiag << Value;
1512
2
      return Diag;
1513
2
    }
SemaDecl.cpp:clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<CheckMultiVersionValue(clang::Sema&, clang::FunctionDecl const*)::ErrType>(clang::Sema::SemaDiagnosticBuilder const&, CheckMultiVersionValue(clang::Sema&, clang::FunctionDecl const*)::ErrType const&)
Line
Count
Source
1509
1
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
1
      const DiagnosticBuilder &BaseDiag = Diag;
1511
1
      BaseDiag << Value;
1512
1
      return Diag;
1513
1
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::NestedNameSpecifier*>(clang::Sema::SemaDiagnosticBuilder const&, clang::NestedNameSpecifier* const&)
Line
Count
Source
1509
357
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
357
      const DiagnosticBuilder &BaseDiag = Diag;
1511
357
      BaseDiag << Value;
1512
357
      return Diag;
1513
357
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::FieldDecl const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::FieldDecl const* const&)
Line
Count
Source
1509
142
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
142
      const DiagnosticBuilder &BaseDiag = Diag;
1511
142
      BaseDiag << Value;
1512
142
      return Diag;
1513
142
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::RecordDecl const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::RecordDecl const* const&)
Line
Count
Source
1509
4
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
4
      const DiagnosticBuilder &BaseDiag = Diag;
1511
4
      BaseDiag << Value;
1512
4
      return Diag;
1513
4
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::AnyX86NoCallerSavedRegistersAttr*>(clang::Sema::SemaDiagnosticBuilder const&, clang::AnyX86NoCallerSavedRegistersAttr* const&)
Line
Count
Source
1509
1
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
1
      const DiagnosticBuilder &BaseDiag = Diag;
1511
1
      BaseDiag << Value;
1512
1
      return Diag;
1513
1
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::VarDecl*>(clang::Sema::SemaDiagnosticBuilder const&, clang::VarDecl* const&)
Line
Count
Source
1509
7.11k
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
7.11k
      const DiagnosticBuilder &BaseDiag = Diag;
1511
7.11k
      BaseDiag << Value;
1512
7.11k
      return Diag;
1513
7.11k
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::TypedefNameDecl*>(clang::Sema::SemaDiagnosticBuilder const&, clang::TypedefNameDecl* const&)
Line
Count
Source
1509
74
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
74
      const DiagnosticBuilder &BaseDiag = Diag;
1511
74
      BaseDiag << Value;
1512
74
      return Diag;
1513
74
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::ConstexprSpecKind>(clang::Sema::SemaDiagnosticBuilder const&, clang::ConstexprSpecKind const&)
Line
Count
Source
1509
260
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
260
      const DiagnosticBuilder &BaseDiag = Diag;
1511
260
      BaseDiag << Value;
1512
260
      return Diag;
1513
260
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::TemplateName>(clang::Sema::SemaDiagnosticBuilder const&, clang::TemplateName const&)
Line
Count
Source
1509
262
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
262
      const DiagnosticBuilder &BaseDiag = Diag;
1511
262
      BaseDiag << Value;
1512
262
      return Diag;
1513
262
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::InheritableAttr const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::InheritableAttr const* const&)
Line
Count
Source
1509
242
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
242
      const DiagnosticBuilder &BaseDiag = Diag;
1511
242
      BaseDiag << Value;
1512
242
      return Diag;
1513
242
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<ShadowedDeclKind>(clang::Sema::SemaDiagnosticBuilder const&, ShadowedDeclKind const&)
Line
Count
Source
1509
186
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
186
      const DiagnosticBuilder &BaseDiag = Diag;
1511
186
      BaseDiag << Value;
1512
186
      return Diag;
1513
186
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::DeclContext const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::DeclContext const* const&)
Line
Count
Source
1509
52
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
52
      const DiagnosticBuilder &BaseDiag = Diag;
1511
52
      BaseDiag << Value;
1512
52
      return Diag;
1513
52
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::StorageClass>(clang::Sema::SemaDiagnosticBuilder const&, clang::StorageClass const&)
Line
Count
Source
1509
1
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
1
      const DiagnosticBuilder &BaseDiag = Diag;
1511
1
      BaseDiag << Value;
1512
1
      return Diag;
1513
1
    }
SemaDecl.cpp:clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::Sema::areMultiversionVariantFunctionsCompatible(clang::FunctionDecl const*, clang::FunctionDecl const*, clang::PartialDiagnostic const&, std::__1::pair<clang::SourceLocation, clang::PartialDiagnostic> const&, std::__1::pair<clang::SourceLocation, clang::PartialDiagnostic> const&, std::__1::pair<clang::SourceLocation, clang::PartialDiagnostic> const&, bool, bool, bool)::DoesntSupport>(clang::Sema::SemaDiagnosticBuilder const&, clang::Sema::areMultiversionVariantFunctionsCompatible(clang::FunctionDecl const*, clang::FunctionDecl const*, clang::PartialDiagnostic const&, std::__1::pair<clang::SourceLocation, clang::PartialDiagnostic> const&, std::__1::pair<clang::SourceLocation, clang::PartialDiagnostic> const&, std::__1::pair<clang::SourceLocation, clang::PartialDiagnostic> const&, bool, bool, bool)::DoesntSupport const&)
Line
Count
Source
1509
23
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
23
      const DiagnosticBuilder &BaseDiag = Diag;
1511
23
      BaseDiag << Value;
1512
23
      return Diag;
1513
23
    }
SemaDecl.cpp:clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::Sema::areMultiversionVariantFunctionsCompatible(clang::FunctionDecl const*, clang::FunctionDecl const*, clang::PartialDiagnostic const&, std::__1::pair<clang::SourceLocation, clang::PartialDiagnostic> const&, std::__1::pair<clang::SourceLocation, clang::PartialDiagnostic> const&, std::__1::pair<clang::SourceLocation, clang::PartialDiagnostic> const&, bool, bool, bool)::Different>(clang::Sema::SemaDiagnosticBuilder const&, clang::Sema::areMultiversionVariantFunctionsCompatible(clang::FunctionDecl const*, clang::FunctionDecl const*, clang::PartialDiagnostic const&, std::__1::pair<clang::SourceLocation, clang::PartialDiagnostic> const&, std::__1::pair<clang::SourceLocation, clang::PartialDiagnostic> const&, std::__1::pair<clang::SourceLocation, clang::PartialDiagnostic> const&, bool, bool, bool)::Different const&)
Line
Count
Source
1509
27
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
27
      const DiagnosticBuilder &BaseDiag = Diag;
1511
27
      BaseDiag << Value;
1512
27
      return Diag;
1513
27
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::Sema::NonTrivialCUnionContext>(clang::Sema::SemaDiagnosticBuilder const&, clang::Sema::NonTrivialCUnionContext const&)
Line
Count
Source
1509
81
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
81
      const DiagnosticBuilder &BaseDiag = Diag;
1511
81
      BaseDiag << Value;
1512
81
      return Diag;
1513
81
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [1]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [1])
Line
Count
Source
1509
104
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
104
      const DiagnosticBuilder &BaseDiag = Diag;
1511
104
      BaseDiag << Value;
1512
104
      return Diag;
1513
104
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<llvm::SmallVector<clang::FixItHint, 1u> >(clang::Sema::SemaDiagnosticBuilder const&, llvm::SmallVector<clang::FixItHint, 1u> const&)
Line
Count
Source
1509
17
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
17
      const DiagnosticBuilder &BaseDiag = Diag;
1511
17
      BaseDiag << Value;
1512
17
      return Diag;
1513
17
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::UsedAttr*>(clang::Sema::SemaDiagnosticBuilder const&, clang::UsedAttr* const&)
Line
Count
Source
1509
4
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
4
      const DiagnosticBuilder &BaseDiag = Diag;
1511
4
      BaseDiag << Value;
1512
4
      return Diag;
1513
4
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::ParmVarDecl const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::ParmVarDecl const* const&)
Line
Count
Source
1509
4
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
4
      const DiagnosticBuilder &BaseDiag = Diag;
1511
4
      BaseDiag << Value;
1512
4
      return Diag;
1513
4
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::TypedefDecl*>(clang::Sema::SemaDiagnosticBuilder const&, clang::TypedefDecl* const&)
Line
Count
Source
1509
1
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
1
      const DiagnosticBuilder &BaseDiag = Diag;
1511
1
      BaseDiag << Value;
1512
1
      return Diag;
1513
1
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::Sema::NonTagKind>(clang::Sema::SemaDiagnosticBuilder const&, clang::Sema::NonTagKind const&)
Line
Count
Source
1509
35
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
35
      const DiagnosticBuilder &BaseDiag = Diag;
1511
35
      BaseDiag << Value;
1512
35
      return Diag;
1513
35
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::TagDecl*>(clang::Sema::SemaDiagnosticBuilder const&, clang::TagDecl* const&)
Line
Count
Source
1509
9
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
9
      const DiagnosticBuilder &BaseDiag = Diag;
1511
9
      BaseDiag << Value;
1512
9
      return Diag;
1513
9
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::RecordDecl*>(clang::Sema::SemaDiagnosticBuilder const&, clang::RecordDecl* const&)
Line
Count
Source
1509
21
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
21
      const DiagnosticBuilder &BaseDiag = Diag;
1511
21
      BaseDiag << Value;
1512
21
      return Diag;
1513
21
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::EnumConstantDecl*>(clang::Sema::SemaDiagnosticBuilder const&, clang::EnumConstantDecl* const&)
Line
Count
Source
1509
25
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
25
      const DiagnosticBuilder &BaseDiag = Diag;
1511
25
      BaseDiag << Value;
1512
25
      return Diag;
1513
25
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::EnumDecl*>(clang::Sema::SemaDiagnosticBuilder const&, clang::EnumDecl* const&)
Line
Count
Source
1509
46
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
46
      const DiagnosticBuilder &BaseDiag = Diag;
1511
46
      BaseDiag << Value;
1512
46
      return Diag;
1513
46
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::CUDALaunchBoundsAttr const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::CUDALaunchBoundsAttr const* const&)
Line
Count
Source
1509
7
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
7
      const DiagnosticBuilder &BaseDiag = Diag;
1511
7
      BaseDiag << Value;
1512
7
      return Diag;
1513
7
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::Mips16Attr const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::Mips16Attr const* const&)
Line
Count
Source
1509
4
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
4
      const DiagnosticBuilder &BaseDiag = Diag;
1511
4
      BaseDiag << Value;
1512
4
      return Diag;
1513
4
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::MicroMipsAttr const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::MicroMipsAttr const* const&)
Line
Count
Source
1509
1
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
1
      const DiagnosticBuilder &BaseDiag = Diag;
1511
1
      BaseDiag << Value;
1512
1
      return Diag;
1513
1
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::MipsInterruptAttr const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::MipsInterruptAttr const* const&)
Line
Count
Source
1509
2
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
2
      const DiagnosticBuilder &BaseDiag = Diag;
1511
2
      BaseDiag << Value;
1512
2
      return Diag;
1513
2
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::MipsShortCallAttr const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::MipsShortCallAttr const* const&)
Line
Count
Source
1509
2
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
2
      const DiagnosticBuilder &BaseDiag = Diag;
1511
2
      BaseDiag << Value;
1512
2
      return Diag;
1513
2
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::MipsLongCallAttr const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::MipsLongCallAttr const* const&)
Line
Count
Source
1509
2
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
2
      const DiagnosticBuilder &BaseDiag = Diag;
1511
2
      BaseDiag << Value;
1512
2
      return Diag;
1513
2
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::ParsedAttr const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::ParsedAttr const* const&)
Line
Count
Source
1509
72
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
72
      const DiagnosticBuilder &BaseDiag = Diag;
1511
72
      BaseDiag << Value;
1512
72
      return Diag;
1513
72
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::NotTailCalledAttr const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::NotTailCalledAttr const* const&)
Line
Count
Source
1509
1
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
1
      const DiagnosticBuilder &BaseDiag = Diag;
1511
1
      BaseDiag << Value;
1512
1
      return Diag;
1513
1
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<AttributeLangSupport::LANG>(clang::Sema::SemaDiagnosticBuilder const&, AttributeLangSupport::LANG const&)
Line
Count
Source
1509
3
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
3
      const DiagnosticBuilder &BaseDiag = Diag;
1511
3
      BaseDiag << Value;
1512
3
      return Diag;
1513
3
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::CUDASharedAttr const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::CUDASharedAttr const* const&)
Line
Count
Source
1509
2
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
2
      const DiagnosticBuilder &BaseDiag = Diag;
1511
2
      BaseDiag << Value;
1512
2
      return Diag;
1513
2
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::CUDADeviceAttr const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::CUDADeviceAttr const* const&)
Line
Count
Source
1509
2
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
2
      const DiagnosticBuilder &BaseDiag = Diag;
1511
2
      BaseDiag << Value;
1512
2
      return Diag;
1513
2
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::CUDAHostAttr const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::CUDAHostAttr const* const&)
Line
Count
Source
1509
2
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
2
      const DiagnosticBuilder &BaseDiag = Diag;
1511
2
      BaseDiag << Value;
1512
2
      return Diag;
1513
2
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::CUDAGlobalAttr const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::CUDAGlobalAttr const* const&)
Line
Count
Source
1509
4
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
4
      const DiagnosticBuilder &BaseDiag = Diag;
1511
4
      BaseDiag << Value;
1512
4
      return Diag;
1513
4
    }
Unexecuted instantiation: clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::CUDADeviceBuiltinTextureTypeAttr const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::CUDADeviceBuiltinTextureTypeAttr const* const&)
Unexecuted instantiation: clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::CUDADeviceBuiltinSurfaceTypeAttr const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::CUDADeviceBuiltinSurfaceTypeAttr const* const&)
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::OwnershipAttr const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::OwnershipAttr const* const&)
Line
Count
Source
1509
1
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
1
      const DiagnosticBuilder &BaseDiag = Diag;
1511
1
      BaseDiag << Value;
1512
1
      return Diag;
1513
1
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::HotAttr const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::HotAttr const* const&)
Line
Count
Source
1509
1
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
1
      const DiagnosticBuilder &BaseDiag = Diag;
1511
1
      BaseDiag << Value;
1512
1
      return Diag;
1513
1
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::ColdAttr const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::ColdAttr const* const&)
Line
Count
Source
1509
1
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
1
      const DiagnosticBuilder &BaseDiag = Diag;
1511
1
      BaseDiag << Value;
1512
1
      return Diag;
1513
1
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::DisableTailCallsAttr const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::DisableTailCallsAttr const* const&)
Line
Count
Source
1509
1
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
1
      const DiagnosticBuilder &BaseDiag = Diag;
1511
1
      BaseDiag << Value;
1512
1
      return Diag;
1513
1
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::CUDAConstantAttr const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::CUDAConstantAttr const* const&)
Line
Count
Source
1509
4
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
4
      const DiagnosticBuilder &BaseDiag = Diag;
1511
4
      BaseDiag << Value;
1512
4
      return Diag;
1513
4
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::VecReturnAttr*>(clang::Sema::SemaDiagnosticBuilder const&, clang::VecReturnAttr* const&)
Line
Count
Source
1509
1
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
1
      const DiagnosticBuilder &BaseDiag = Diag;
1511
1
      BaseDiag << Value;
1512
1
      return Diag;
1513
1
    }
Unexecuted instantiation: clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::CFUnknownTransferAttr const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::CFUnknownTransferAttr const* const&)
Unexecuted instantiation: clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::CFAuditedTransferAttr const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::CFAuditedTransferAttr const* const&)
SemaDeclAttr.cpp:clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<handleXReturnsXRetainedAttr(clang::Sema&, clang::Decl*, clang::ParsedAttr const&)::$_0>(clang::Sema::SemaDiagnosticBuilder const&, handleXReturnsXRetainedAttr(clang::Sema&, clang::Decl*, clang::ParsedAttr const&)::$_0 const&)
Line
Count
Source
1509
13
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
13
      const DiagnosticBuilder &BaseDiag = Diag;
1511
13
      BaseDiag << Value;
1512
13
      return Diag;
1513
13
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::NoSpeculativeLoadHardeningAttr const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::NoSpeculativeLoadHardeningAttr const* const&)
Line
Count
Source
1509
3
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
3
      const DiagnosticBuilder &BaseDiag = Diag;
1511
3
      BaseDiag << Value;
1512
3
      return Diag;
1513
3
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::SpeculativeLoadHardeningAttr const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::SpeculativeLoadHardeningAttr const* const&)
Line
Count
Source
1509
3
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
3
      const DiagnosticBuilder &BaseDiag = Diag;
1511
3
      BaseDiag << Value;
1512
3
      return Diag;
1513
3
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::AlwaysInlineAttr const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::AlwaysInlineAttr const* const&)
Line
Count
Source
1509
1
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
1
      const DiagnosticBuilder &BaseDiag = Diag;
1511
1
      BaseDiag << Value;
1512
1
      return Diag;
1513
1
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::NakedAttr const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::NakedAttr const* const&)
Line
Count
Source
1509
1
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
1
      const DiagnosticBuilder &BaseDiag = Diag;
1511
1
      BaseDiag << Value;
1512
1
      return Diag;
1513
1
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::OwnerAttr const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::OwnerAttr const* const&)
Line
Count
Source
1509
3
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
3
      const DiagnosticBuilder &BaseDiag = Diag;
1511
3
      BaseDiag << Value;
1512
3
      return Diag;
1513
3
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::PointerAttr const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::PointerAttr const* const&)
Line
Count
Source
1509
1
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
1
      const DiagnosticBuilder &BaseDiag = Diag;
1511
1
      BaseDiag << Value;
1512
1
      return Diag;
1513
1
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [4]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [4])
Line
Count
Source
1509
71
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
71
      const DiagnosticBuilder &BaseDiag = Diag;
1511
71
      BaseDiag << Value;
1512
71
      return Diag;
1513
71
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::NoDestroyAttr const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::NoDestroyAttr const* const&)
Line
Count
Source
1509
4
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
4
      const DiagnosticBuilder &BaseDiag = Diag;
1511
4
      BaseDiag << Value;
1512
4
      return Diag;
1513
4
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::AlwaysDestroyAttr const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::AlwaysDestroyAttr const* const&)
Line
Count
Source
1509
4
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
4
      const DiagnosticBuilder &BaseDiag = Diag;
1511
4
      BaseDiag << Value;
1512
4
      return Diag;
1513
4
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::AssumeAlignedAttr*>(clang::Sema::SemaDiagnosticBuilder const&, clang::AssumeAlignedAttr* const&)
Line
Count
Source
1509
3
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
3
      const DiagnosticBuilder &BaseDiag = Diag;
1511
3
      BaseDiag << Value;
1512
3
      return Diag;
1513
3
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::AllocAlignAttr*>(clang::Sema::SemaDiagnosticBuilder const&, clang::AllocAlignAttr* const&)
Line
Count
Source
1509
5
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
5
      const DiagnosticBuilder &BaseDiag = Diag;
1511
5
      BaseDiag << Value;
1512
5
      return Diag;
1513
5
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::AllocAlignAttr const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::AllocAlignAttr const* const&)
Line
Count
Source
1509
5
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
5
      const DiagnosticBuilder &BaseDiag = Diag;
1511
5
      BaseDiag << Value;
1512
5
      return Diag;
1513
5
    }
SemaDeclAttr.cpp:clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::Sema::checkTargetAttr(clang::SourceLocation, llvm::StringRef)::FirstParam>(clang::Sema::SemaDiagnosticBuilder const&, clang::Sema::checkTargetAttr(clang::SourceLocation, llvm::StringRef)::FirstParam const&)
Line
Count
Source
1509
13
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
13
      const DiagnosticBuilder &BaseDiag = Diag;
1511
13
      BaseDiag << Value;
1512
13
      return Diag;
1513
13
    }
SemaDeclAttr.cpp:clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::Sema::checkTargetAttr(clang::SourceLocation, llvm::StringRef)::SecondParam>(clang::Sema::SemaDiagnosticBuilder const&, clang::Sema::checkTargetAttr(clang::SourceLocation, llvm::StringRef)::SecondParam const&)
Line
Count
Source
1509
13
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
13
      const DiagnosticBuilder &BaseDiag = Diag;
1511
13
      BaseDiag << Value;
1512
13
      return Diag;
1513
13
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [18]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [18])
Line
Count
Source
1509
14
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
14
      const DiagnosticBuilder &BaseDiag = Diag;
1511
14
      BaseDiag << Value;
1512
14
      return Diag;
1513
14
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::AlignValueAttr*>(clang::Sema::SemaDiagnosticBuilder const&, clang::AlignValueAttr* const&)
Line
Count
Source
1509
1
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
1
      const DiagnosticBuilder &BaseDiag = Diag;
1511
1
      BaseDiag << Value;
1512
1
      return Diag;
1513
1
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::CommonAttr const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::CommonAttr const* const&)
Line
Count
Source
1509
4
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
4
      const DiagnosticBuilder &BaseDiag = Diag;
1511
4
      BaseDiag << Value;
1512
4
      return Diag;
1513
4
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::InternalLinkageAttr const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::InternalLinkageAttr const* const&)
Line
Count
Source
1509
2
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
2
      const DiagnosticBuilder &BaseDiag = Diag;
1511
2
      BaseDiag << Value;
1512
2
      return Diag;
1513
2
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::AlwaysInlineAttr*>(clang::Sema::SemaDiagnosticBuilder const&, clang::AlwaysInlineAttr* const&)
Line
Count
Source
1509
7
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
7
      const DiagnosticBuilder &BaseDiag = Diag;
1511
7
      BaseDiag << Value;
1512
7
      return Diag;
1513
7
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::MinSizeAttr*>(clang::Sema::SemaDiagnosticBuilder const&, clang::MinSizeAttr* const&)
Line
Count
Source
1509
3
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
3
      const DiagnosticBuilder &BaseDiag = Diag;
1511
3
      BaseDiag << Value;
1512
3
      return Diag;
1513
3
    }
Unexecuted instantiation: clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::ParameterABIAttr*>(clang::Sema::SemaDiagnosticBuilder const&, clang::ParameterABIAttr* const&)
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::AMDGPUFlatWorkGroupSizeAttr const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::AMDGPUFlatWorkGroupSizeAttr const* const&)
Line
Count
Source
1509
12
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
12
      const DiagnosticBuilder &BaseDiag = Diag;
1511
12
      BaseDiag << Value;
1512
12
      return Diag;
1513
12
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::AMDGPUWavesPerEUAttr const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::AMDGPUWavesPerEUAttr const* const&)
Line
Count
Source
1509
13
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
13
      const DiagnosticBuilder &BaseDiag = Diag;
1511
13
      BaseDiag << Value;
1512
13
      return Diag;
1513
13
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::DLLImportAttr*>(clang::Sema::SemaDiagnosticBuilder const&, clang::DLLImportAttr* const&)
Line
Count
Source
1509
142
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
142
      const DiagnosticBuilder &BaseDiag = Diag;
1511
142
      BaseDiag << Value;
1512
142
      return Diag;
1513
142
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::ReqdWorkGroupSizeAttr const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::ReqdWorkGroupSizeAttr const* const&)
Line
Count
Source
1509
2
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
2
      const DiagnosticBuilder &BaseDiag = Diag;
1511
2
      BaseDiag << Value;
1512
2
      return Diag;
1513
2
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::WorkGroupSizeHintAttr const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::WorkGroupSizeHintAttr const* const&)
Line
Count
Source
1509
2
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
2
      const DiagnosticBuilder &BaseDiag = Diag;
1511
2
      BaseDiag << Value;
1512
2
      return Diag;
1513
2
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::VecTypeHintAttr const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::VecTypeHintAttr const* const&)
Line
Count
Source
1509
2
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
2
      const DiagnosticBuilder &BaseDiag = Diag;
1511
2
      BaseDiag << Value;
1512
2
      return Diag;
1513
2
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::OpenCLIntelReqdSubGroupSizeAttr const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::OpenCLIntelReqdSubGroupSizeAttr const* const&)
Line
Count
Source
1509
2
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
2
      const DiagnosticBuilder &BaseDiag = Diag;
1511
2
      BaseDiag << Value;
1512
2
      return Diag;
1513
2
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::AMDGPUNumSGPRAttr const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::AMDGPUNumSGPRAttr const* const&)
Line
Count
Source
1509
1
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
1
      const DiagnosticBuilder &BaseDiag = Diag;
1511
1
      BaseDiag << Value;
1512
1
      return Diag;
1513
1
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::AMDGPUNumVGPRAttr const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::AMDGPUNumVGPRAttr const* const&)
Line
Count
Source
1509
1
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
1
      const DiagnosticBuilder &BaseDiag = Diag;
1511
1
      BaseDiag << Value;
1512
1
      return Diag;
1513
1
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::Sema::AbstractDiagSelID>(clang::Sema::SemaDiagnosticBuilder const&, clang::Sema::AbstractDiagSelID const&)
Line
Count
Source
1509
11
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
11
      const DiagnosticBuilder &BaseDiag = Diag;
1511
11
      BaseDiag << Value;
1512
11
      return Diag;
1513
11
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::ClassTemplateDecl*>(clang::Sema::SemaDiagnosticBuilder const&, clang::ClassTemplateDecl* const&)
Line
Count
Source
1509
25
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
25
      const DiagnosticBuilder &BaseDiag = Diag;
1511
25
      BaseDiag << Value;
1512
25
      return Diag;
1513
25
    }
SemaDeclCXX.cpp:clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<(anonymous namespace)::DefaultedComparisonSubobject::$_7>(clang::Sema::SemaDiagnosticBuilder const&, (anonymous namespace)::DefaultedComparisonSubobject::$_7 const&)
Line
Count
Source
1509
30
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
30
      const DiagnosticBuilder &BaseDiag = Diag;
1511
30
      BaseDiag << Value;
1512
30
      return Diag;
1513
30
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<TrivialSubobjectKind>(clang::Sema::SemaDiagnosticBuilder const&, TrivialSubobjectKind const&)
Line
Count
Source
1509
210
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
210
      const DiagnosticBuilder &BaseDiag = Diag;
1511
210
      BaseDiag << Value;
1512
210
      return Diag;
1513
210
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::CXXConstructorDecl*>(clang::Sema::SemaDiagnosticBuilder const&, clang::CXXConstructorDecl* const&)
Line
Count
Source
1509
7
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
7
      const DiagnosticBuilder &BaseDiag = Diag;
1511
7
      BaseDiag << Value;
1512
7
      return Diag;
1513
7
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::DecompositionDecl*>(clang::Sema::SemaDiagnosticBuilder const&, clang::DecompositionDecl* const&)
Line
Count
Source
1509
7
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
7
      const DiagnosticBuilder &BaseDiag = Diag;
1511
7
      BaseDiag << Value;
1512
7
      return Diag;
1513
7
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::AccessSpecifier>(clang::Sema::SemaDiagnosticBuilder const&, clang::AccessSpecifier const&)
Line
Count
Source
1509
16
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
16
      const DiagnosticBuilder &BaseDiag = Diag;
1511
16
      BaseDiag << Value;
1512
16
      return Diag;
1513
16
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::Attr*>(clang::Sema::SemaDiagnosticBuilder const&, clang::Attr* const&)
Line
Count
Source
1509
17
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
17
      const DiagnosticBuilder &BaseDiag = Diag;
1511
17
      BaseDiag << Value;
1512
17
      return Diag;
1513
17
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::InheritableAttr*>(clang::Sema::SemaDiagnosticBuilder const&, clang::InheritableAttr* const&)
Line
Count
Source
1509
8
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
8
      const DiagnosticBuilder &BaseDiag = Diag;
1511
8
      BaseDiag << Value;
1512
8
      return Diag;
1513
8
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::ClassTemplateSpecializationDecl*>(clang::Sema::SemaDiagnosticBuilder const&, clang::ClassTemplateSpecializationDecl* const&)
Line
Count
Source
1509
76
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
76
      const DiagnosticBuilder &BaseDiag = Diag;
1511
76
      BaseDiag << Value;
1512
76
      return Diag;
1513
76
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::FieldDecl*>(clang::Sema::SemaDiagnosticBuilder const&, clang::FieldDecl* const&)
Line
Count
Source
1509
865
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
865
      const DiagnosticBuilder &BaseDiag = Diag;
1511
865
      BaseDiag << Value;
1512
865
      return Diag;
1513
865
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::NamespaceDecl*>(clang::Sema::SemaDiagnosticBuilder const&, clang::NamespaceDecl* const&)
Line
Count
Source
1509
40
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
40
      const DiagnosticBuilder &BaseDiag = Diag;
1511
40
      BaseDiag << Value;
1512
40
      return Diag;
1513
40
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [15]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [15])
Line
Count
Source
1509
14
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
14
      const DiagnosticBuilder &BaseDiag = Diag;
1511
14
      BaseDiag << Value;
1512
14
      return Diag;
1513
14
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<std::__1::pair<clang::NullabilityKind, bool> >(clang::Sema::SemaDiagnosticBuilder const&, std::__1::pair<clang::NullabilityKind, bool> const&)
Line
Count
Source
1509
130
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
130
      const DiagnosticBuilder &BaseDiag = Diag;
1511
130
      BaseDiag << Value;
1512
130
      return Diag;
1513
130
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::ObjCMethodDecl*>(clang::Sema::SemaDiagnosticBuilder const&, clang::ObjCMethodDecl* const&)
Line
Count
Source
1509
2.64k
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
2.64k
      const DiagnosticBuilder &BaseDiag = Diag;
1511
2.64k
      BaseDiag << Value;
1512
2.64k
      return Diag;
1513
2.64k
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::NamedDecl*>(clang::Sema::SemaDiagnosticBuilder const&, clang::NamedDecl* const&)
Line
Count
Source
1509
152k
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
152k
      const DiagnosticBuilder &BaseDiag = Diag;
1511
152k
      BaseDiag << Value;
1512
152k
      return Diag;
1513
152k
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::TagTypeKind>(clang::Sema::SemaDiagnosticBuilder const&, clang::TagTypeKind const&)
Line
Count
Source
1509
317
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
317
      const DiagnosticBuilder &BaseDiag = Diag;
1511
317
      BaseDiag << Value;
1512
317
      return Diag;
1513
317
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::ObjCMethodDecl const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::ObjCMethodDecl const* const&)
Line
Count
Source
1509
3
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
3
      const DiagnosticBuilder &BaseDiag = Diag;
1511
3
      BaseDiag << Value;
1512
3
      return Diag;
1513
3
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::ObjCProtocolDecl const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::ObjCProtocolDecl const* const&)
Line
Count
Source
1509
5
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
5
      const DiagnosticBuilder &BaseDiag = Diag;
1511
5
      BaseDiag << Value;
1512
5
      return Diag;
1513
5
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::ObjCMethodFamily>(clang::Sema::SemaDiagnosticBuilder const&, clang::ObjCMethodFamily const&)
Line
Count
Source
1509
48
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
48
      const DiagnosticBuilder &BaseDiag = Diag;
1511
48
      BaseDiag << Value;
1512
48
      return Diag;
1513
48
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [10]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [10])
Line
Count
Source
1509
288
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
288
      const DiagnosticBuilder &BaseDiag = Diag;
1511
288
      BaseDiag << Value;
1512
288
      return Diag;
1513
288
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::Selector>(clang::Sema::SemaDiagnosticBuilder const&, clang::Selector const&)
Line
Count
Source
1509
4.03k
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
4.03k
      const DiagnosticBuilder &BaseDiag = Diag;
1511
4.03k
      BaseDiag << Value;
1512
4.03k
      return Diag;
1513
4.03k
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::ObjCProtocolDecl*>(clang::Sema::SemaDiagnosticBuilder const&, clang::ObjCProtocolDecl* const&)
Line
Count
Source
1509
33
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
33
      const DiagnosticBuilder &BaseDiag = Diag;
1511
33
      BaseDiag << Value;
1512
33
      return Diag;
1513
33
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::ObjCIvarDecl const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::ObjCIvarDecl const* const&)
Line
Count
Source
1509
10
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
10
      const DiagnosticBuilder &BaseDiag = Diag;
1511
10
      BaseDiag << Value;
1512
10
      return Diag;
1513
10
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::CanQual<clang::Type> >(clang::Sema::SemaDiagnosticBuilder const&, clang::CanQual<clang::Type> const&)
Line
Count
Source
1509
77
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
77
      const DiagnosticBuilder &BaseDiag = Diag;
1511
77
      BaseDiag << Value;
1512
77
      return Diag;
1513
77
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<llvm::SmallString<40u> >(clang::Sema::SemaDiagnosticBuilder const&, llvm::SmallString<40u> const&)
Line
Count
Source
1509
9.24k
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
9.24k
      const DiagnosticBuilder &BaseDiag = Diag;
1511
9.24k
      BaseDiag << Value;
1512
9.24k
      return Diag;
1513
9.24k
    }
SemaExpr.cpp:clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<$_7>(clang::Sema::SemaDiagnosticBuilder const&, $_7 const&)
Line
Count
Source
1509
330
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
330
      const DiagnosticBuilder &BaseDiag = Diag;
1511
330
      BaseDiag << Value;
1512
330
      return Diag;
1513
330
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::CXXMethodDecl const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::CXXMethodDecl const* const&)
Line
Count
Source
1509
36
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
36
      const DiagnosticBuilder &BaseDiag = Diag;
1511
36
      BaseDiag << Value;
1512
36
      return Diag;
1513
36
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<OriginalExprKind>(clang::Sema::SemaDiagnosticBuilder const&, OriginalExprKind const&)
Line
Count
Source
1509
11
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
11
      const DiagnosticBuilder &BaseDiag = Diag;
1511
11
      BaseDiag << Value;
1512
11
      return Diag;
1513
11
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::TypeAliasTemplateDecl*>(clang::Sema::SemaDiagnosticBuilder const&, clang::TypeAliasTemplateDecl* const&)
Line
Count
Source
1509
7
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
7
      const DiagnosticBuilder &BaseDiag = Diag;
1511
7
      BaseDiag << Value;
1512
7
      return Diag;
1513
7
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::UsingPackDecl*>(clang::Sema::SemaDiagnosticBuilder const&, clang::UsingPackDecl* const&)
Line
Count
Source
1509
2
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
2
      const DiagnosticBuilder &BaseDiag = Diag;
1511
2
      BaseDiag << Value;
1512
2
      return Diag;
1513
2
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::Sema::VariadicCallType>(clang::Sema::SemaDiagnosticBuilder const&, clang::Sema::VariadicCallType const&)
Line
Count
Source
1509
6
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
6
      const DiagnosticBuilder &BaseDiag = Diag;
1511
6
      BaseDiag << Value;
1512
6
      return Diag;
1513
6
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::Expr*>(clang::Sema::SemaDiagnosticBuilder const&, clang::Expr* const&)
Line
Count
Source
1509
301
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
301
      const DiagnosticBuilder &BaseDiag = Diag;
1511
301
      BaseDiag << Value;
1512
301
      return Diag;
1513
301
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [2]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [2])
Line
Count
Source
1509
109
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
109
      const DiagnosticBuilder &BaseDiag = Diag;
1511
109
      BaseDiag << Value;
1512
109
      return Diag;
1513
109
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::ObjCInterfaceDecl const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::ObjCInterfaceDecl const* const&)
Line
Count
Source
1509
3
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
3
      const DiagnosticBuilder &BaseDiag = Diag;
1511
3
      BaseDiag << Value;
1512
3
      return Diag;
1513
3
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::Sema::AssignmentAction>(clang::Sema::SemaDiagnosticBuilder const&, clang::Sema::AssignmentAction const&)
Line
Count
Source
1509
88
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
88
      const DiagnosticBuilder &BaseDiag = Diag;
1511
88
      BaseDiag << Value;
1512
88
      return Diag;
1513
88
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::Sema::ObjCLiteralKind>(clang::Sema::SemaDiagnosticBuilder const&, clang::Sema::ObjCLiteralKind const&)
Line
Count
Source
1509
79
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
79
      const DiagnosticBuilder &BaseDiag = Diag;
1511
79
      BaseDiag << Value;
1512
79
      return Diag;
1513
79
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [3]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [3])
Line
Count
Source
1509
254
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
254
      const DiagnosticBuilder &BaseDiag = Diag;
1511
254
      BaseDiag << Value;
1512
254
      return Diag;
1513
254
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::tok::TokenKind>(clang::Sema::SemaDiagnosticBuilder const&, clang::tok::TokenKind const&)
Line
Count
Source
1509
2
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
2
      const DiagnosticBuilder &BaseDiag = Diag;
1511
2
      BaseDiag << Value;
1512
2
      return Diag;
1513
2
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::ObjCBridgeCastKind>(clang::Sema::SemaDiagnosticBuilder const&, clang::ObjCBridgeCastKind const&)
Line
Count
Source
1509
3
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
3
      const DiagnosticBuilder &BaseDiag = Diag;
1511
3
      BaseDiag << Value;
1512
3
      return Diag;
1513
3
    }
SemaInit.cpp:clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<(anonymous namespace)::ReferenceKind>(clang::Sema::SemaDiagnosticBuilder const&, (anonymous namespace)::ReferenceKind const&)
Line
Count
Source
1509
106
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
106
      const DiagnosticBuilder &BaseDiag = Diag;
1511
106
      BaseDiag << Value;
1512
106
      return Diag;
1513
106
    }
SemaObjCProperty.cpp:clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<SelectPropertyForSynthesisFromProtocols(clang::Sema&, clang::SourceLocation, clang::ObjCInterfaceDecl*, clang::ObjCPropertyDecl*)::MismatchKind>(clang::Sema::SemaDiagnosticBuilder const&, SelectPropertyForSynthesisFromProtocols(clang::Sema&, clang::SourceLocation, clang::ObjCInterfaceDecl*, clang::ObjCPropertyDecl*)::MismatchKind const&)
Line
Count
Source
1509
24
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
24
      const DiagnosticBuilder &BaseDiag = Diag;
1511
24
      BaseDiag << Value;
1512
24
      return Diag;
1513
24
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::ObjCPropertyDecl*>(clang::Sema::SemaDiagnosticBuilder const&, clang::ObjCPropertyDecl* const&)
Line
Count
Source
1509
31
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
31
      const DiagnosticBuilder &BaseDiag = Diag;
1511
31
      BaseDiag << Value;
1512
31
      return Diag;
1513
31
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::ObjCIvarDecl*>(clang::Sema::SemaDiagnosticBuilder const&, clang::ObjCIvarDecl* const&)
Line
Count
Source
1509
46
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
46
      const DiagnosticBuilder &BaseDiag = Diag;
1511
46
      BaseDiag << Value;
1512
46
      return Diag;
1513
46
    }
SemaOpenMP.cpp:clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<reportOriginalDsa(clang::Sema&, (anonymous namespace)::DSAStackTy const*, clang::ValueDecl const*, (anonymous namespace)::DSAStackTy::DSAVarData const&, bool)::$_16>(clang::Sema::SemaDiagnosticBuilder const&, reportOriginalDsa(clang::Sema&, (anonymous namespace)::DSAStackTy const*, clang::ValueDecl const*, (anonymous namespace)::DSAStackTy::DSAVarData const&, bool)::$_16 const&)
Line
Count
Source
1509
1.07k
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
1.07k
      const DiagnosticBuilder &BaseDiag = Diag;
1511
1.07k
      BaseDiag << Value;
1512
1.07k
      return Diag;
1513
1.07k
    }
SemaOpenMP.cpp:clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<getPrivateItem(clang::Sema&, clang::Expr*&, clang::SourceLocation&, clang::SourceRange&, bool)::$_18>(clang::Sema::SemaDiagnosticBuilder const&, getPrivateItem(clang::Sema&, clang::Expr*&, clang::SourceLocation&, clang::SourceRange&, bool)::$_18 const&)
Line
Count
Source
1509
24
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
24
      const DiagnosticBuilder &BaseDiag = Diag;
1511
24
      BaseDiag << Value;
1512
24
      return Diag;
1513
24
    }
SemaOpenMP.cpp:clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<checkNestingOfRegions(clang::Sema&, (anonymous namespace)::DSAStackTy const*, llvm::omp::Directive, clang::DeclarationNameInfo const&, llvm::omp::Directive, clang::SourceLocation)::$_17>(clang::Sema::SemaDiagnosticBuilder const&, checkNestingOfRegions(clang::Sema&, (anonymous namespace)::DSAStackTy const*, llvm::omp::Directive, clang::DeclarationNameInfo const&, llvm::omp::Directive, clang::SourceLocation)::$_17 const&)
Line
Count
Source
1509
6.14k
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
6.14k
      const DiagnosticBuilder &BaseDiag = Diag;
1511
6.14k
      BaseDiag << Value;
1512
6.14k
      return Diag;
1513
6.14k
    }
SemaOpenMP.cpp:clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<(anonymous namespace)::OpenMPAtomicUpdateChecker::ExprAnalysisErrorCode>(clang::Sema::SemaDiagnosticBuilder const&, (anonymous namespace)::OpenMPAtomicUpdateChecker::ExprAnalysisErrorCode const&)
Line
Count
Source
1509
800
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
800
      const DiagnosticBuilder &BaseDiag = Diag;
1511
800
      BaseDiag << Value;
1512
800
      return Diag;
1513
800
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [13]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [13])
Line
Count
Source
1509
4
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
4
      const DiagnosticBuilder &BaseDiag = Diag;
1511
4
      BaseDiag << Value;
1512
4
      return Diag;
1513
4
    }
SemaOpenMP.cpp:clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::Sema::checkOpenMPDeclareVariantFunction(clang::OpaquePtr<clang::DeclGroupRef>, clang::Expr*, clang::OMPTraitInfo&, clang::SourceRange)::DoesntSupport>(clang::Sema::SemaDiagnosticBuilder const&, clang::Sema::checkOpenMPDeclareVariantFunction(clang::OpaquePtr<clang::DeclGroupRef>, clang::Expr*, clang::OMPTraitInfo&, clang::SourceRange)::DoesntSupport const&)
Line
Count
Source
1509
10
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
10
      const DiagnosticBuilder &BaseDiag = Diag;
1511
10
      BaseDiag << Value;
1512
10
      return Diag;
1513
10
    }
SemaOpenMP.cpp:clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::Sema::ActOnOpenMPAtomicDirective(llvm::ArrayRef<clang::OMPClause*>, clang::Stmt*, clang::SourceLocation, clang::SourceLocation)::$_23>(clang::Sema::SemaDiagnosticBuilder const&, clang::Sema::ActOnOpenMPAtomicDirective(llvm::ArrayRef<clang::OMPClause*>, clang::Stmt*, clang::SourceLocation, clang::SourceLocation)::$_23 const&)
Line
Count
Source
1509
72
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
72
      const DiagnosticBuilder &BaseDiag = Diag;
1511
72
      BaseDiag << Value;
1512
72
      return Diag;
1513
72
    }
SemaOpenMP.cpp:clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::Sema::ActOnOpenMPAtomicDirective(llvm::ArrayRef<clang::OMPClause*>, clang::Stmt*, clang::SourceLocation, clang::SourceLocation)::$_24>(clang::Sema::SemaDiagnosticBuilder const&, clang::Sema::ActOnOpenMPAtomicDirective(llvm::ArrayRef<clang::OMPClause*>, clang::Stmt*, clang::SourceLocation, clang::SourceLocation)::$_24 const&)
Line
Count
Source
1509
48
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
48
      const DiagnosticBuilder &BaseDiag = Diag;
1511
48
      BaseDiag << Value;
1512
48
      return Diag;
1513
48
    }
SemaOpenMP.cpp:clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::Sema::ActOnOpenMPAtomicDirective(llvm::ArrayRef<clang::OMPClause*>, clang::Stmt*, clang::SourceLocation, clang::SourceLocation)::$_25>(clang::Sema::SemaDiagnosticBuilder const&, clang::Sema::ActOnOpenMPAtomicDirective(llvm::ArrayRef<clang::OMPClause*>, clang::Stmt*, clang::SourceLocation, clang::SourceLocation)::$_25 const&)
Line
Count
Source
1509
72
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
72
      const DiagnosticBuilder &BaseDiag = Diag;
1511
72
      BaseDiag << Value;
1512
72
      return Diag;
1513
72
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<char [50]>(clang::Sema::SemaDiagnosticBuilder const&, char const (&) [50])
Line
Count
Source
1509
16
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
16
      const DiagnosticBuilder &BaseDiag = Diag;
1511
16
      BaseDiag << Value;
1512
16
      return Diag;
1513
16
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::Sema::CCEKind>(clang::Sema::SemaDiagnosticBuilder const&, clang::Sema::CCEKind const&)
Line
Count
Source
1509
100
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
100
      const DiagnosticBuilder &BaseDiag = Diag;
1511
100
      BaseDiag << Value;
1512
100
      return Diag;
1513
100
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::CXXRecordDecl*>(clang::Sema::SemaDiagnosticBuilder const&, clang::CXXRecordDecl* const&)
Line
Count
Source
1509
6.90k
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
6.90k
      const DiagnosticBuilder &BaseDiag = Diag;
1511
6.90k
      BaseDiag << Value;
1512
6.90k
      return Diag;
1513
6.90k
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::ParmVarDecl*>(clang::Sema::SemaDiagnosticBuilder const&, clang::ParmVarDecl* const&)
Line
Count
Source
1509
369
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
369
      const DiagnosticBuilder &BaseDiag = Diag;
1511
369
      BaseDiag << Value;
1512
369
      return Diag;
1513
369
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::Qualifiers>(clang::Sema::SemaDiagnosticBuilder const&, clang::Qualifiers const&)
Line
Count
Source
1509
80
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
80
      const DiagnosticBuilder &BaseDiag = Diag;
1511
80
      BaseDiag << Value;
1512
80
      return Diag;
1513
80
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::LangAS>(clang::Sema::SemaDiagnosticBuilder const&, clang::LangAS const&)
Line
Count
Source
1509
56
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
56
      const DiagnosticBuilder &BaseDiag = Diag;
1511
56
      BaseDiag << Value;
1512
56
      return Diag;
1513
56
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::Qualifiers::ObjCLifetime>(clang::Sema::SemaDiagnosticBuilder const&, clang::Qualifiers::ObjCLifetime const&)
Line
Count
Source
1509
285
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
285
      const DiagnosticBuilder &BaseDiag = Diag;
1511
285
      BaseDiag << Value;
1512
285
      return Diag;
1513
285
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::Qualifiers::GC>(clang::Sema::SemaDiagnosticBuilder const&, clang::Qualifiers::GC const&)
Line
Count
Source
1509
4
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
4
      const DiagnosticBuilder &BaseDiag = Diag;
1511
4
      BaseDiag << Value;
1512
4
      return Diag;
1513
4
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::Sema::CUDAFunctionTarget>(clang::Sema::SemaDiagnosticBuilder const&, clang::Sema::CUDAFunctionTarget const&)
Line
Count
Source
1509
458
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
458
      const DiagnosticBuilder &BaseDiag = Diag;
1511
458
      BaseDiag << Value;
1512
458
      return Diag;
1513
458
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::TemplateArgument>(clang::Sema::SemaDiagnosticBuilder const&, clang::TemplateArgument const&)
Line
Count
Source
1509
545
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
545
      const DiagnosticBuilder &BaseDiag = Diag;
1511
545
      BaseDiag << Value;
1512
545
      return Diag;
1513
545
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<llvm::SmallString<128u> >(clang::Sema::SemaDiagnosticBuilder const&, llvm::SmallString<128u> const&)
Line
Count
Source
1509
4.86k
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
4.86k
      const DiagnosticBuilder &BaseDiag = Diag;
1511
4.86k
      BaseDiag << Value;
1512
4.86k
      return Diag;
1513
4.86k
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::TemplateDecl*>(clang::Sema::SemaDiagnosticBuilder const&, clang::TemplateDecl* const&)
Line
Count
Source
1509
1.08k
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
1.08k
      const DiagnosticBuilder &BaseDiag = Diag;
1511
1.08k
      BaseDiag << Value;
1512
1.08k
      return Diag;
1513
1.08k
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::DeclContext*>(clang::Sema::SemaDiagnosticBuilder const&, clang::DeclContext* const&)
Line
Count
Source
1509
34.0k
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
34.0k
      const DiagnosticBuilder &BaseDiag = Diag;
1511
34.0k
      BaseDiag << Value;
1512
34.0k
      return Diag;
1513
34.0k
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::RefQualifierKind>(clang::Sema::SemaDiagnosticBuilder const&, clang::RefQualifierKind const&)
Line
Count
Source
1509
22
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
22
      const DiagnosticBuilder &BaseDiag = Diag;
1511
22
      BaseDiag << Value;
1512
22
      return Diag;
1513
22
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::NamedDecl const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::NamedDecl const* const&)
Line
Count
Source
1509
125k
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
125k
      const DiagnosticBuilder &BaseDiag = Diag;
1511
125k
      BaseDiag << Value;
1512
125k
      return Diag;
1513
125k
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::Sema::CXXSpecialMember>(clang::Sema::SemaDiagnosticBuilder const&, clang::Sema::CXXSpecialMember const&)
Line
Count
Source
1509
1.49k
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
1.49k
      const DiagnosticBuilder &BaseDiag = Diag;
1511
1.49k
      BaseDiag << Value;
1512
1.49k
      return Diag;
1513
1.49k
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::FunctionDecl*>(clang::Sema::SemaDiagnosticBuilder const&, clang::FunctionDecl* const&)
Line
Count
Source
1509
162k
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
162k
      const DiagnosticBuilder &BaseDiag = Diag;
1511
162k
      BaseDiag << Value;
1512
162k
      return Diag;
1513
162k
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::CXXMethodDecl*>(clang::Sema::SemaDiagnosticBuilder const&, clang::CXXMethodDecl* const&)
Line
Count
Source
1509
15
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
15
      const DiagnosticBuilder &BaseDiag = Diag;
1511
15
      BaseDiag << Value;
1512
15
      return Diag;
1513
15
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::CXXRecordDecl const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::CXXRecordDecl const* const&)
Line
Count
Source
1509
221
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
221
      const DiagnosticBuilder &BaseDiag = Diag;
1511
221
      BaseDiag << Value;
1512
221
      return Diag;
1513
221
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::WarnUnusedResultAttr const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::WarnUnusedResultAttr const* const&)
Line
Count
Source
1509
117
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
117
      const DiagnosticBuilder &BaseDiag = Diag;
1511
117
      BaseDiag << Value;
1512
117
      return Diag;
1513
117
    }
SemaStmt.cpp:clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<(anonymous namespace)::BeginEndFunction>(clang::Sema::SemaDiagnosticBuilder const&, (anonymous namespace)::BeginEndFunction const&)
Line
Count
Source
1509
46
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
46
      const DiagnosticBuilder &BaseDiag = Diag;
1511
46
      BaseDiag << Value;
1512
46
      return Diag;
1513
46
    }
SemaStmtAsm.cpp:clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<checkExprMemoryConstraintCompat(clang::Sema&, clang::Expr*, clang::TargetInfo::ConstraintInfo&, bool)::$_0>(clang::Sema::SemaDiagnosticBuilder const&, checkExprMemoryConstraintCompat(clang::Sema&, clang::Expr*, clang::TargetInfo::ConstraintInfo&, bool)::$_0 const&)
Line
Count
Source
1509
6
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
6
      const DiagnosticBuilder &BaseDiag = Diag;
1511
6
      BaseDiag << Value;
1512
6
      return Diag;
1513
6
    }
Unexecuted instantiation: clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::UnlikelyAttr const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::UnlikelyAttr const* const&)
Unexecuted instantiation: clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::LikelyAttr const*>(clang::Sema::SemaDiagnosticBuilder const&, clang::LikelyAttr const* const&)
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::ConceptDecl*>(clang::Sema::SemaDiagnosticBuilder const&, clang::ConceptDecl* const&)
Line
Count
Source
1509
53
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
53
      const DiagnosticBuilder &BaseDiag = Diag;
1511
53
      BaseDiag << Value;
1512
53
      return Diag;
1513
53
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::VarTemplateSpecializationDecl*>(clang::Sema::SemaDiagnosticBuilder const&, clang::VarTemplateSpecializationDecl* const&)
Line
Count
Source
1509
3
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
3
      const DiagnosticBuilder &BaseDiag = Diag;
1511
3
      BaseDiag << Value;
1512
3
      return Diag;
1513
3
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::TemplateTemplateParmDecl*>(clang::Sema::SemaDiagnosticBuilder const&, clang::TemplateTemplateParmDecl* const&)
Line
Count
Source
1509
4
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
4
      const DiagnosticBuilder &BaseDiag = Diag;
1511
4
      BaseDiag << Value;
1512
4
      return Diag;
1513
4
    }
SemaTemplate.cpp:clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::Sema::CheckDependentFunctionTemplateSpecialization(clang::FunctionDecl*, clang::TemplateArgumentListInfo const&, clang::LookupResult&)::DiscardReason>(clang::Sema::SemaDiagnosticBuilder const&, clang::Sema::CheckDependentFunctionTemplateSpecialization(clang::FunctionDecl*, clang::TemplateArgumentListInfo const&, clang::LookupResult&)::DiscardReason const&)
Line
Count
Source
1509
4
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
4
      const DiagnosticBuilder &BaseDiag = Diag;
1511
4
      BaseDiag << Value;
1512
4
      return Diag;
1513
4
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::VarTemplateDecl*>(clang::Sema::SemaDiagnosticBuilder const&, clang::VarTemplateDecl* const&)
Line
Count
Source
1509
21
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
21
      const DiagnosticBuilder &BaseDiag = Diag;
1511
21
      BaseDiag << Value;
1512
21
      return Diag;
1513
21
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::DeducedTemplateArgument>(clang::Sema::SemaDiagnosticBuilder const&, clang::DeducedTemplateArgument const&)
Line
Count
Source
1509
19
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
19
      const DiagnosticBuilder &BaseDiag = Diag;
1511
19
      BaseDiag << Value;
1512
19
      return Diag;
1513
19
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::MSPropertyDecl*>(clang::Sema::SemaDiagnosticBuilder const&, clang::MSPropertyDecl* const&)
Line
Count
Source
1509
25
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
25
      const DiagnosticBuilder &BaseDiag = Diag;
1511
25
      BaseDiag << Value;
1512
25
      return Diag;
1513
25
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::ObjCInterfaceDecl*>(clang::Sema::SemaDiagnosticBuilder const&, clang::ObjCInterfaceDecl* const&)
Line
Count
Source
1509
5
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
5
      const DiagnosticBuilder &BaseDiag = Diag;
1511
5
      BaseDiag << Value;
1512
5
      return Diag;
1513
5
    }
SemaType.cpp:clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<(anonymous namespace)::QualifiedFunctionKind>(clang::Sema::SemaDiagnosticBuilder const&, (anonymous namespace)::QualifiedFunctionKind const&)
Line
Count
Source
1509
22
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
22
      const DiagnosticBuilder &BaseDiag = Diag;
1511
22
      BaseDiag << Value;
1512
22
      return Diag;
1513
22
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<TypeDiagSelector>(clang::Sema::SemaDiagnosticBuilder const&, TypeDiagSelector const&)
Line
Count
Source
1509
54
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
54
      const DiagnosticBuilder &BaseDiag = Diag;
1511
54
      BaseDiag << Value;
1512
54
      return Diag;
1513
54
    }
SemaType.cpp:clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<GetFullTypeForDeclarator((anonymous namespace)::TypeProcessingState&, clang::QualType, clang::TypeSourceInfo*)::$_1>(clang::Sema::SemaDiagnosticBuilder const&, GetFullTypeForDeclarator((anonymous namespace)::TypeProcessingState&, clang::QualType, clang::TypeSourceInfo*)::$_1 const&)
Line
Count
Source
1509
50
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
50
      const DiagnosticBuilder &BaseDiag = Diag;
1511
50
      BaseDiag << Value;
1512
50
      return Diag;
1513
50
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<llvm::IntegerType::'unnamed'>(clang::Sema::SemaDiagnosticBuilder const&, llvm::IntegerType::'unnamed' const&)
Line
Count
Source
1509
2
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
2
      const DiagnosticBuilder &BaseDiag = Diag;
1511
2
      BaseDiag << Value;
1512
2
      return Diag;
1513
2
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::ArrayType::ArraySizeModifier>(clang::Sema::SemaDiagnosticBuilder const&, clang::ArrayType::ArraySizeModifier const&)
Line
Count
Source
1509
5
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
5
      const DiagnosticBuilder &BaseDiag = Diag;
1511
5
      BaseDiag << Value;
1512
5
      return Diag;
1513
5
    }
clang::Sema::SemaDiagnosticBuilder const& clang::operator<<<clang::AttributeArgumentNType>(clang::Sema::SemaDiagnosticBuilder const&, clang::AttributeArgumentNType const&)
Line
Count
Source
1509
153
        const SemaDiagnosticBuilder &Diag, const T &Value) {
1510
153
      const DiagnosticBuilder &BaseDiag = Diag;
1511
153
      BaseDiag << Value;
1512
153
      return Diag;
1513
153
    }
1514
  };
1515
1516
  /// Emit a diagnostic.
1517
2.68M
  SemaDiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID) {
1518
2.68M
    DiagnosticBuilder DB = Diags.Report(Loc, DiagID);
1519
2.68M
    return SemaDiagnosticBuilder(DB, *this, DiagID);
1520
2.68M
  }
1521
1522
  /// Emit a partial diagnostic.
1523
  SemaDiagnosticBuilder Diag(SourceLocation Loc, const PartialDiagnostic& PD);
1524
1525
  /// Build a partial diagnostic.
1526
  PartialDiagnostic PDiag(unsigned DiagID = 0); // in SemaInternal.h
1527
1528
  bool findMacroSpelling(SourceLocation &loc, StringRef name);
1529
1530
  /// Get a string to suggest for zero-initialization of a type.
1531
  std::string
1532
  getFixItZeroInitializerForType(QualType T, SourceLocation Loc) const;
1533
  std::string getFixItZeroLiteralForType(QualType T, SourceLocation Loc) const;
1534
1535
  /// Calls \c Lexer::getLocForEndOfToken()
1536
  SourceLocation getLocForEndOfToken(SourceLocation Loc, unsigned Offset = 0);
1537
1538
  /// Retrieve the module loader associated with the preprocessor.
1539
  ModuleLoader &getModuleLoader() const;
1540
1541
  /// Invent a new identifier for parameters of abbreviated templates.
1542
  IdentifierInfo *
1543
  InventAbbreviatedTemplateParameterTypeName(IdentifierInfo *ParamName,
1544
                                             unsigned Index);
1545
1546
  void emitAndClearUnusedLocalTypedefWarnings();
1547
1548
  private:
1549
    /// Function or variable declarations to be checked for whether the deferred
1550
    /// diagnostics should be emitted.
1551
    SmallVector<Decl *, 4> DeclsToCheckForDeferredDiags;
1552
1553
  public:
1554
  // Emit all deferred diagnostics.
1555
  void emitDeferredDiags();
1556
1557
  enum TUFragmentKind {
1558
    /// The global module fragment, between 'module;' and a module-declaration.
1559
    Global,
1560
    /// A normal translation unit fragment. For a non-module unit, this is the
1561
    /// entire translation unit. Otherwise, it runs from the module-declaration
1562
    /// to the private-module-fragment (if any) or the end of the TU (if not).
1563
    Normal,
1564
    /// The private module fragment, between 'module :private;' and the end of
1565
    /// the translation unit.
1566
    Private
1567
  };
1568
1569
  void ActOnStartOfTranslationUnit();
1570
  void ActOnEndOfTranslationUnit();
1571
  void ActOnEndOfTranslationUnitFragment(TUFragmentKind Kind);
1572
1573
  void CheckDelegatingCtorCycles();
1574
1575
  Scope *getScopeForContext(DeclContext *Ctx);
1576
1577
  void PushFunctionScope();
1578
  void PushBlockScope(Scope *BlockScope, BlockDecl *Block);
1579
  sema::LambdaScopeInfo *PushLambdaScope();
1580
1581
  /// This is used to inform Sema what the current TemplateParameterDepth
1582
  /// is during Parsing.  Currently it is used to pass on the depth
1583
  /// when parsing generic lambda 'auto' parameters.
1584
  void RecordParsingTemplateParameterDepth(unsigned Depth);
1585
1586
  void PushCapturedRegionScope(Scope *RegionScope, CapturedDecl *CD,
1587
                               RecordDecl *RD, CapturedRegionKind K,
1588
                               unsigned OpenMPCaptureLevel = 0);
1589
1590
  /// Custom deleter to allow FunctionScopeInfos to be kept alive for a short
1591
  /// time after they've been popped.
1592
  class PoppedFunctionScopeDeleter {
1593
    Sema *Self;
1594
1595
  public:
1596
3.93M
    explicit PoppedFunctionScopeDeleter(Sema *Self) : Self(Self) {}
1597
    void operator()(sema::FunctionScopeInfo *Scope) const;
1598
  };
1599
1600
  using PoppedFunctionScopePtr =
1601
      std::unique_ptr<sema::FunctionScopeInfo, PoppedFunctionScopeDeleter>;
1602
1603
  PoppedFunctionScopePtr
1604
  PopFunctionScopeInfo(const sema::AnalysisBasedWarnings::Policy *WP = nullptr,
1605
                       const Decl *D = nullptr,
1606
                       QualType BlockType = QualType());
1607
1608
26.4M
  sema::FunctionScopeInfo *getCurFunction() const {
1609
26.2M
    return FunctionScopes.empty() ? 
nullptr242k
: FunctionScopes.back();
1610
26.4M
  }
1611
1612
  sema::FunctionScopeInfo *getEnclosingFunction() const;
1613
1614
  void setFunctionHasBranchIntoScope();
1615
  void setFunctionHasBranchProtectedScope();
1616
  void setFunctionHasIndirectGoto();
1617
1618
  void PushCompoundScope(bool IsStmtExpr);
1619
  void PopCompoundScope();
1620
1621
  sema::CompoundScopeInfo &getCurCompoundScope() const;
1622
1623
  bool hasAnyUnrecoverableErrorsInThisFunction() const;
1624
1625
  /// Retrieve the current block, if any.
1626
  sema::BlockScopeInfo *getCurBlock();
1627
1628
  /// Get the innermost lambda enclosing the current location, if any. This
1629
  /// looks through intervening non-lambda scopes such as local functions and
1630
  /// blocks.
1631
  sema::LambdaScopeInfo *getEnclosingLambda() const;
1632
1633
  /// Retrieve the current lambda scope info, if any.
1634
  /// \param IgnoreNonLambdaCapturingScope true if should find the top-most
1635
  /// lambda scope info ignoring all inner capturing scopes that are not
1636
  /// lambda scopes.
1637
  sema::LambdaScopeInfo *
1638
  getCurLambda(bool IgnoreNonLambdaCapturingScope = false);
1639
1640
  /// Retrieve the current generic lambda info, if any.
1641
  sema::LambdaScopeInfo *getCurGenericLambda();
1642
1643
  /// Retrieve the current captured region, if any.
1644
  sema::CapturedRegionScopeInfo *getCurCapturedRegion();
1645
1646
  /// WeakTopLevelDeclDecls - access to \#pragma weak-generated Decls
1647
74.6k
  SmallVectorImpl<Decl *> &WeakTopLevelDecls() { return WeakTopLevelDecl; }
1648
1649
  /// Called before parsing a function declarator belonging to a function
1650
  /// declaration.
1651
  void ActOnStartFunctionDeclarationDeclarator(Declarator &D,
1652
                                               unsigned TemplateParameterDepth);
1653
1654
  /// Called after parsing a function declarator belonging to a function
1655
  /// declaration.
1656
  void ActOnFinishFunctionDeclarationDeclarator(Declarator &D);
1657
1658
  void ActOnComment(SourceRange Comment);
1659
1660
  //===--------------------------------------------------------------------===//
1661
  // Type Analysis / Processing: SemaType.cpp.
1662
  //
1663
1664
  QualType BuildQualifiedType(QualType T, SourceLocation Loc, Qualifiers Qs,
1665
                              const DeclSpec *DS = nullptr);
1666
  QualType BuildQualifiedType(QualType T, SourceLocation Loc, unsigned CVRA,
1667
                              const DeclSpec *DS = nullptr);
1668
  QualType BuildPointerType(QualType T,
1669
                            SourceLocation Loc, DeclarationName Entity);
1670
  QualType BuildReferenceType(QualType T, bool LValueRef,
1671
                              SourceLocation Loc, DeclarationName Entity);
1672
  QualType BuildArrayType(QualType T, ArrayType::ArraySizeModifier ASM,
1673
                          Expr *ArraySize, unsigned Quals,
1674
                          SourceRange Brackets, DeclarationName Entity);
1675
  QualType BuildVectorType(QualType T, Expr *VecSize, SourceLocation AttrLoc);
1676
  QualType BuildExtVectorType(QualType T, Expr *ArraySize,
1677
                              SourceLocation AttrLoc);
1678
  QualType BuildMatrixType(QualType T, Expr *NumRows, Expr *NumColumns,
1679
                           SourceLocation AttrLoc);
1680
1681
  QualType BuildAddressSpaceAttr(QualType &T, LangAS ASIdx, Expr *AddrSpace,
1682
                                 SourceLocation AttrLoc);
1683
1684
  /// Same as above, but constructs the AddressSpace index if not provided.
1685
  QualType BuildAddressSpaceAttr(QualType &T, Expr *AddrSpace,
1686
                                 SourceLocation AttrLoc);
1687
1688
  bool CheckQualifiedFunctionForTypeId(QualType T, SourceLocation Loc);
1689
1690
  bool CheckFunctionReturnType(QualType T, SourceLocation Loc);
1691
1692
  /// Build a function type.
1693
  ///
1694
  /// This routine checks the function type according to C++ rules and
1695
  /// under the assumption that the result type and parameter types have
1696
  /// just been instantiated from a template. It therefore duplicates
1697
  /// some of the behavior of GetTypeForDeclarator, but in a much
1698
  /// simpler form that is only suitable for this narrow use case.
1699
  ///
1700
  /// \param T The return type of the function.
1701
  ///
1702
  /// \param ParamTypes The parameter types of the function. This array
1703
  /// will be modified to account for adjustments to the types of the
1704
  /// function parameters.
1705
  ///
1706
  /// \param Loc The location of the entity whose type involves this
1707
  /// function type or, if there is no such entity, the location of the
1708
  /// type that will have function type.
1709
  ///
1710
  /// \param Entity The name of the entity that involves the function
1711
  /// type, if known.
1712
  ///
1713
  /// \param EPI Extra information about the function type. Usually this will
1714
  /// be taken from an existing function with the same prototype.
1715
  ///
1716
  /// \returns A suitable function type, if there are no errors. The
1717
  /// unqualified type will always be a FunctionProtoType.
1718
  /// Otherwise, returns a NULL type.
1719
  QualType BuildFunctionType(QualType T,
1720
                             MutableArrayRef<QualType> ParamTypes,
1721
                             SourceLocation Loc, DeclarationName Entity,
1722
                             const FunctionProtoType::ExtProtoInfo &EPI);
1723
1724
  QualType BuildMemberPointerType(QualType T, QualType Class,
1725
                                  SourceLocation Loc,
1726
                                  DeclarationName Entity);
1727
  QualType BuildBlockPointerType(QualType T,
1728
                                 SourceLocation Loc, DeclarationName Entity);
1729
  QualType BuildParenType(QualType T);
1730
  QualType BuildAtomicType(QualType T, SourceLocation Loc);
1731
  QualType BuildReadPipeType(QualType T,
1732
                         SourceLocation Loc);
1733
  QualType BuildWritePipeType(QualType T,
1734
                         SourceLocation Loc);
1735
  QualType BuildExtIntType(bool IsUnsigned, Expr *BitWidth, SourceLocation Loc);
1736
1737
  TypeSourceInfo *GetTypeForDeclarator(Declarator &D, Scope *S);
1738
  TypeSourceInfo *GetTypeForDeclaratorCast(Declarator &D, QualType FromTy);
1739
1740
  /// Package the given type and TSI into a ParsedType.
1741
  ParsedType CreateParsedType(QualType T, TypeSourceInfo *TInfo);
1742
  DeclarationNameInfo GetNameForDeclarator(Declarator &D);
1743
  DeclarationNameInfo GetNameFromUnqualifiedId(const UnqualifiedId &Name);
1744
  static QualType GetTypeFromParser(ParsedType Ty,
1745
                                    TypeSourceInfo **TInfo = nullptr);
1746
  CanThrowResult canThrow(const Stmt *E);
1747
  /// Determine whether the callee of a particular function call can throw.
1748
  /// E, D and Loc are all optional.
1749
  static CanThrowResult canCalleeThrow(Sema &S, const Expr *E, const Decl *D,
1750
                                       SourceLocation Loc = SourceLocation());
1751
  const FunctionProtoType *ResolveExceptionSpec(SourceLocation Loc,
1752
                                                const FunctionProtoType *FPT);
1753
  void UpdateExceptionSpec(FunctionDecl *FD,
1754
                           const FunctionProtoType::ExceptionSpecInfo &ESI);
1755
  bool CheckSpecifiedExceptionType(QualType &T, SourceRange Range);
1756
  bool CheckDistantExceptionSpec(QualType T);
1757
  bool CheckEquivalentExceptionSpec(FunctionDecl *Old, FunctionDecl *New);
1758
  bool CheckEquivalentExceptionSpec(
1759
      const FunctionProtoType *Old, SourceLocation OldLoc,
1760
      const FunctionProtoType *New, SourceLocation NewLoc);
1761
  bool CheckEquivalentExceptionSpec(
1762
      const PartialDiagnostic &DiagID, const PartialDiagnostic & NoteID,
1763
      const FunctionProtoType *Old, SourceLocation OldLoc,
1764
      const FunctionProtoType *New, SourceLocation NewLoc);
1765
  bool handlerCanCatch(QualType HandlerType, QualType ExceptionType);
1766
  bool CheckExceptionSpecSubset(const PartialDiagnostic &DiagID,
1767
                                const PartialDiagnostic &NestedDiagID,
1768
                                const PartialDiagnostic &NoteID,
1769
                                const PartialDiagnostic &NoThrowDiagID,
1770
                                const FunctionProtoType *Superset,
1771
                                SourceLocation SuperLoc,
1772
                                const FunctionProtoType *Subset,
1773
                                SourceLocation SubLoc);
1774
  bool CheckParamExceptionSpec(const PartialDiagnostic &NestedDiagID,
1775
                               const PartialDiagnostic &NoteID,
1776
                               const FunctionProtoType *Target,
1777
                               SourceLocation TargetLoc,
1778
                               const FunctionProtoType *Source,
1779
                               SourceLocation SourceLoc);
1780
1781
  TypeResult ActOnTypeName(Scope *S, Declarator &D);
1782
1783
  /// The parser has parsed the context-sensitive type 'instancetype'
1784
  /// in an Objective-C message declaration. Return the appropriate type.
1785
  ParsedType ActOnObjCInstanceType(SourceLocation Loc);
1786
1787
  /// Abstract class used to diagnose incomplete types.
1788
  struct TypeDiagnoser {
1789
75.7M
    TypeDiagnoser() {}
1790
1791
    virtual void diagnose(Sema &S, SourceLocation Loc, QualType T) = 0;
1792
75.7M
    virtual ~TypeDiagnoser() {}
1793
  };
1794
1795
1.86k
  static int getPrintable(int I) { return I; }
1796
53
  static unsigned getPrintable(unsigned I) { return I; }
1797
125
  static bool getPrintable(bool B) { return B; }
1798
147
  static const char * getPrintable(const char *S) { return S; }
1799
0
  static StringRef getPrintable(StringRef S) { return S; }
1800
0
  static const std::string &getPrintable(const std::string &S) { return S; }
1801
5
  static const IdentifierInfo *getPrintable(const IdentifierInfo *II) {
1802
5
    return II;
1803
5
  }
1804
21
  static DeclarationName getPrintable(DeclarationName N) { return N; }
1805
6
  static QualType getPrintable(QualType T) { return T; }
1806
543
  static SourceRange getPrintable(SourceRange R) { return R; }
1807
0
  static SourceRange getPrintable(SourceLocation L) { return L; }
1808
63
  static SourceRange getPrintable(const Expr *E) { return E->getSourceRange(); }
1809
12
  static SourceRange getPrintable(TypeLoc TL) { return TL.getSourceRange();}
1810
1811
  template <typename... Ts> class BoundTypeDiagnoser : public TypeDiagnoser {
1812
  protected:
1813
    unsigned DiagID;
1814
    std::tuple<const Ts &...> Args;
1815
1816
    template <std::size_t... Is>
1817
    void emit(const SemaDiagnosticBuilder &DB,
1818
5.40k
              std::index_sequence<Is...>) const {
1819
      // Apply all tuple elements to the builder in order.
1820
5.40k
      bool Dummy[] = {false, (DB << getPrintable(std::get<Is>(Args)))...};
1821
5.40k
      (void)Dummy;
1822
5.40k
    }
void clang::Sema::BoundTypeDiagnoser<>::emit<>(clang::Sema::SemaDiagnosticBuilder const&, std::__1::integer_sequence<unsigned long>) const
Line
Count
Source
1818
2.89k
              std::index_sequence<Is...>) const {
1819
      // Apply all tuple elements to the builder in order.
1820
2.89k
      bool Dummy[] = {false, (DB << getPrintable(std::get<Is>(Args)))...};
1821
2.89k
      (void)Dummy;
1822
2.89k
    }
void clang::Sema::BoundTypeDiagnoser<clang::Sema::AbstractDiagSelID>::emit<0ul>(clang::Sema::SemaDiagnosticBuilder const&, std::__1::integer_sequence<unsigned long, 0ul>) const
Line
Count
Source
1818
1.84k
              std::index_sequence<Is...>) const {
1819
      // Apply all tuple elements to the builder in order.
1820
1.84k
      bool Dummy[] = {false, (DB << getPrintable(std::get<Is>(Args)))...};
1821
1.84k
      (void)Dummy;
1822
1.84k
    }
Unexecuted instantiation: void clang::Sema::BoundTypeDiagnoser<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::emit<0ul>(clang::Sema::SemaDiagnosticBuilder const&, std::__1::integer_sequence<unsigned long, 0ul>) const
void clang::Sema::BoundTypeDiagnoser<unsigned int, clang::SourceRange, bool, bool>::emit<0ul, 1ul, 2ul, 3ul>(clang::Sema::SemaDiagnosticBuilder const&, std::__1::integer_sequence<unsigned long, 0ul, 1ul, 2ul, 3ul>) const
Line
Count
Source
1818
53
              std::index_sequence<Is...>) const {
1819
      // Apply all tuple elements to the builder in order.
1820
53
      bool Dummy[] = {false, (DB << getPrintable(std::get<Is>(Args)))...};
1821
53
      (void)Dummy;
1822
53
    }
void clang::Sema::BoundTypeDiagnoser<clang::DeclarationName, clang::IdentifierInfo*, clang::SourceRange>::emit<0ul, 1ul, 2ul>(clang::Sema::SemaDiagnosticBuilder const&, std::__1::integer_sequence<unsigned long, 0ul, 1ul, 2ul>) const
Line
Count
Source
1818
5
              std::index_sequence<Is...>) const {
1819
      // Apply all tuple elements to the builder in order.
1820
5
      bool Dummy[] = {false, (DB << getPrintable(std::get<Is>(Args)))...};
1821
5
      (void)Dummy;
1822
5
    }
void clang::Sema::BoundTypeDiagnoser<bool>::emit<0ul>(clang::Sema::SemaDiagnosticBuilder const&, std::__1::integer_sequence<unsigned long, 0ul>) const
Line
Count
Source
1818
19
              std::index_sequence<Is...>) const {
1819
      // Apply all tuple elements to the builder in order.
1820
19
      bool Dummy[] = {false, (DB << getPrintable(std::get<Is>(Args)))...};
1821
19
      (void)Dummy;
1822
19
    }
void clang::Sema::BoundTypeDiagnoser<int, clang::SourceRange>::emit<0ul, 1ul>(clang::Sema::SemaDiagnosticBuilder const&, std::__1::integer_sequence<unsigned long, 0ul, 1ul>) const
Line
Count
Source
1818
16
              std::index_sequence<Is...>) const {
1819
      // Apply all tuple elements to the builder in order.
1820
16
      bool Dummy[] = {false, (DB << getPrintable(std::get<Is>(Args)))...};
1821
16
      (void)Dummy;
1822
16
    }
void clang::Sema::BoundTypeDiagnoser<clang::DeclarationName>::emit<0ul>(clang::Sema::SemaDiagnosticBuilder const&, std::__1::integer_sequence<unsigned long, 0ul>) const
Line
Count
Source
1818
14
              std::index_sequence<Is...>) const {
1819
      // Apply all tuple elements to the builder in order.
1820
14
      bool Dummy[] = {false, (DB << getPrintable(std::get<Is>(Args)))...};
1821
14
      (void)Dummy;
1822
14
    }
void clang::Sema::BoundTypeDiagnoser<char const*, clang::SourceRange>::emit<0ul, 1ul>(clang::Sema::SemaDiagnosticBuilder const&, std::__1::integer_sequence<unsigned long, 0ul, 1ul>) const
Line
Count
Source
1818
144
              std::index_sequence<Is...>) const {
1819
      // Apply all tuple elements to the builder in order.
1820
144
      bool Dummy[] = {false, (DB << getPrintable(std::get<Is>(Args)))...};
1821
144
      (void)Dummy;
1822
144
    }
void clang::Sema::BoundTypeDiagnoser<char const*, int>::emit<0ul, 1ul>(clang::Sema::SemaDiagnosticBuilder const&, std::__1::integer_sequence<unsigned long, 0ul, 1ul>) const
Line
Count
Source
1818
3
              std::index_sequence<Is...>) const {
1819
      // Apply all tuple elements to the builder in order.
1820
3
      bool Dummy[] = {false, (DB << getPrintable(std::get<Is>(Args)))...};
1821
3
      (void)Dummy;
1822
3
    }
void clang::Sema::BoundTypeDiagnoser<clang::TypeLoc>::emit<0ul>(clang::Sema::SemaDiagnosticBuilder const&, std::__1::integer_sequence<unsigned long, 0ul>) const
Line
Count
Source
1818
12
              std::index_sequence<Is...>) const {
1819
      // Apply all tuple elements to the builder in order.
1820
12
      bool Dummy[] = {false, (DB << getPrintable(std::get<Is>(Args)))...};
1821
12
      (void)Dummy;
1822
12
    }
void clang::Sema::BoundTypeDiagnoser<clang::DeclarationName, clang::SourceRange>::emit<0ul, 1ul>(clang::Sema::SemaDiagnosticBuilder const&, std::__1::integer_sequence<unsigned long, 0ul, 1ul>) const
Line
Count
Source
1818
1
              std::index_sequence<Is...>) const {
1819
      // Apply all tuple elements to the builder in order.
1820
1
      bool Dummy[] = {false, (DB << getPrintable(std::get<Is>(Args)))...};
1821
1
      (void)Dummy;
1822
1
    }
void clang::Sema::BoundTypeDiagnoser<clang::DeclarationName, clang::Expr*>::emit<0ul, 1ul>(clang::Sema::SemaDiagnosticBuilder const&, std::__1::integer_sequence<unsigned long, 0ul, 1ul>) const
Line
Count
Source
1818
1
              std::index_sequence<Is...>) const {
1819
      // Apply all tuple elements to the builder in order.
1820
1
      bool Dummy[] = {false, (DB << getPrintable(std::get<Is>(Args)))...};
1821
1
      (void)Dummy;
1822
1
    }
void clang::Sema::BoundTypeDiagnoser<clang::SourceRange>::emit<0ul>(clang::Sema::SemaDiagnosticBuilder const&, std::__1::integer_sequence<unsigned long, 0ul>) const
Line
Count
Source
1818
322
              std::index_sequence<Is...>) const {
1819
      // Apply all tuple elements to the builder in order.
1820
322
      bool Dummy[] = {false, (DB << getPrintable(std::get<Is>(Args)))...};
1821
322
      (void)Dummy;
1822
322
    }
void clang::Sema::BoundTypeDiagnoser<clang::QualType, clang::SourceRange>::emit<0ul, 1ul>(clang::Sema::SemaDiagnosticBuilder const&, std::__1::integer_sequence<unsigned long, 0ul, 1ul>) const
Line
Count
Source
1818
2
              std::index_sequence<Is...>) const {
1819
      // Apply all tuple elements to the builder in order.
1820
2
      bool Dummy[] = {false, (DB << getPrintable(std::get<Is>(Args)))...};
1821
2
      (void)Dummy;
1822
2
    }
void clang::Sema::BoundTypeDiagnoser<clang::Expr*>::emit<0ul>(clang::Sema::SemaDiagnosticBuilder const&, std::__1::integer_sequence<unsigned long, 0ul>) const
Line
Count
Source
1818
62
              std::index_sequence<Is...>) const {
1819
      // Apply all tuple elements to the builder in order.
1820
62
      bool Dummy[] = {false, (DB << getPrintable(std::get<Is>(Args)))...};
1821
62
      (void)Dummy;
1822
62
    }
void clang::Sema::BoundTypeDiagnoser<clang::QualType>::emit<0ul>(clang::Sema::SemaDiagnosticBuilder const&, std::__1::integer_sequence<unsigned long, 0ul>) const
Line
Count
Source
1818
4
              std::index_sequence<Is...>) const {
1819
      // Apply all tuple elements to the builder in order.
1820
4
      bool Dummy[] = {false, (DB << getPrintable(std::get<Is>(Args)))...};
1821
4
      (void)Dummy;
1822
4
    }
void clang::Sema::BoundTypeDiagnoser<int>::emit<0ul>(clang::Sema::SemaDiagnosticBuilder const&, std::__1::integer_sequence<unsigned long, 0ul>) const
Line
Count
Source
1818
1
              std::index_sequence<Is...>) const {
1819
      // Apply all tuple elements to the builder in order.
1820
1
      bool Dummy[] = {false, (DB << getPrintable(std::get<Is>(Args)))...};
1821
1
      (void)Dummy;
1822
1
    }
1823
1824
  public:
1825
    BoundTypeDiagnoser(unsigned DiagID, const Ts &...Args)
1826
75.7M
        : TypeDiagnoser(), DiagID(DiagID), Args(Args...) {
1827
75.7M
      assert(DiagID != 0 && "no diagnostic for type diagnoser");
1828
75.7M
    }
clang::Sema::BoundTypeDiagnoser<>::BoundTypeDiagnoser(unsigned int)
Line
Count
Source
1826
23.4M
        : TypeDiagnoser(), DiagID(DiagID), Args(Args...) {
1827
23.4M
      assert(DiagID != 0 && "no diagnostic for type diagnoser");
1828
23.4M
    }
clang::Sema::BoundTypeDiagnoser<clang::Sema::AbstractDiagSelID>::BoundTypeDiagnoser(unsigned int, clang::Sema::AbstractDiagSelID const&)
Line
Count
Source
1826
43.1M
        : TypeDiagnoser(), DiagID(DiagID), Args(Args...) {
1827
43.1M
      assert(DiagID != 0 && "no diagnostic for type diagnoser");
1828
43.1M
    }
clang::Sema::BoundTypeDiagnoser<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::BoundTypeDiagnoser(unsigned int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
Line
Count
Source
1826
2
        : TypeDiagnoser(), DiagID(DiagID), Args(Args...) {
1827
2
      assert(DiagID != 0 && "no diagnostic for type diagnoser");
1828
2
    }
clang::Sema::BoundTypeDiagnoser<unsigned int, clang::SourceRange, bool, bool>::BoundTypeDiagnoser(unsigned int, unsigned int const&, clang::SourceRange const&, bool const&, bool const&)
Line
Count
Source
1826
39.6k
        : TypeDiagnoser(), DiagID(DiagID), Args(Args...) {
1827
39.6k
      assert(DiagID != 0 && "no diagnostic for type diagnoser");
1828
39.6k
    }
clang::Sema::BoundTypeDiagnoser<clang::DeclarationName, clang::IdentifierInfo*, clang::SourceRange>::BoundTypeDiagnoser(unsigned int, clang::DeclarationName const&, clang::IdentifierInfo* const&, clang::SourceRange const&)
Line
Count
Source
1826
81.9k
        : TypeDiagnoser(), DiagID(DiagID), Args(Args...) {
1827
81.9k
      assert(DiagID != 0 && "no diagnostic for type diagnoser");
1828
81.9k
    }
clang::Sema::BoundTypeDiagnoser<bool>::BoundTypeDiagnoser(unsigned int, bool const&)
Line
Count
Source
1826
113k
        : TypeDiagnoser(), DiagID(DiagID), Args(Args...) {
1827
113k
      assert(DiagID != 0 && "no diagnostic for type diagnoser");
1828
113k
    }
clang::Sema::BoundTypeDiagnoser<int, clang::SourceRange>::BoundTypeDiagnoser(unsigned int, int const&, clang::SourceRange const&)
Line
Count
Source
1826
766
        : TypeDiagnoser(), DiagID(DiagID), Args(Args...) {
1827
766
      assert(DiagID != 0 && "no diagnostic for type diagnoser");
1828
766
    }
clang::Sema::BoundTypeDiagnoser<clang::DeclarationName>::BoundTypeDiagnoser(unsigned int, clang::DeclarationName const&)
Line
Count
Source
1826
3.68k
        : TypeDiagnoser(), DiagID(DiagID), Args(Args...) {
1827
3.68k
      assert(DiagID != 0 && "no diagnostic for type diagnoser");
1828
3.68k
    }
clang::Sema::BoundTypeDiagnoser<char const*, clang::SourceRange>::BoundTypeDiagnoser(unsigned int, char const* const&, clang::SourceRange const&)
Line
Count
Source
1826
73.4k
        : TypeDiagnoser(), DiagID(DiagID), Args(Args...) {
1827
73.4k
      assert(DiagID != 0 && "no diagnostic for type diagnoser");
1828
73.4k
    }
clang::Sema::BoundTypeDiagnoser<char const*, int>::BoundTypeDiagnoser(unsigned int, char const* const&, int const&)
Line
Count
Source
1826
63
        : TypeDiagnoser(), DiagID(DiagID), Args(Args...) {
1827
63
      assert(DiagID != 0 && "no diagnostic for type diagnoser");
1828
63
    }
clang::Sema::BoundTypeDiagnoser<clang::TypeLoc>::BoundTypeDiagnoser(unsigned int, clang::TypeLoc const&)
Line
Count
Source
1826
2.06k
        : TypeDiagnoser(), DiagID(DiagID), Args(Args...) {
1827
2.06k
      assert(DiagID != 0 && "no diagnostic for type diagnoser");
1828
2.06k
    }
clang::Sema::BoundTypeDiagnoser<clang::DeclarationName, clang::SourceRange>::BoundTypeDiagnoser(unsigned int, clang::DeclarationName const&, clang::SourceRange const&)
Line
Count
Source
1826
2.19k
        : TypeDiagnoser(), DiagID(DiagID), Args(Args...) {
1827
2.19k
      assert(DiagID != 0 && "no diagnostic for type diagnoser");
1828
2.19k
    }
clang::Sema::BoundTypeDiagnoser<clang::DeclarationName, clang::Expr*>::BoundTypeDiagnoser(unsigned int, clang::DeclarationName const&, clang::Expr* const&)
Line
Count
Source
1826
1
        : TypeDiagnoser(), DiagID(DiagID), Args(Args...) {
1827
1
      assert(DiagID != 0 && "no diagnostic for type diagnoser");
1828
1
    }
clang::Sema::BoundTypeDiagnoser<clang::SourceRange>::BoundTypeDiagnoser(unsigned int, clang::SourceRange const&)
Line
Count
Source
1826
3.08M
        : TypeDiagnoser(), DiagID(DiagID), Args(Args...) {
1827
3.08M
      assert(DiagID != 0 && "no diagnostic for type diagnoser");
1828
3.08M
    }
clang::Sema::BoundTypeDiagnoser<clang::QualType, clang::SourceRange>::BoundTypeDiagnoser(unsigned int, clang::QualType const&, clang::SourceRange const&)
Line
Count
Source
1826
666
        : TypeDiagnoser(), DiagID(DiagID), Args(Args...) {
1827
666
      assert(DiagID != 0 && "no diagnostic for type diagnoser");
1828
666
    }
clang::Sema::BoundTypeDiagnoser<clang::Expr*>::BoundTypeDiagnoser(unsigned int, clang::Expr* const&)
Line
Count
Source
1826
5.77M
        : TypeDiagnoser(), DiagID(DiagID), Args(Args...) {
1827
5.77M
      assert(DiagID != 0 && "no diagnostic for type diagnoser");
1828
5.77M
    }
clang::Sema::BoundTypeDiagnoser<clang::QualType>::BoundTypeDiagnoser(unsigned int, clang::QualType const&)
Line
Count
Source
1826
93
        : TypeDiagnoser(), DiagID(DiagID), Args(Args...) {
1827
93
      assert(DiagID != 0 && "no diagnostic for type diagnoser");
1828
93
    }
clang::Sema::BoundTypeDiagnoser<int>::BoundTypeDiagnoser(unsigned int, int const&)
Line
Count
Source
1826
2.43k
        : TypeDiagnoser(), DiagID(DiagID), Args(Args...) {
1827
2.43k
      assert(DiagID != 0 && "no diagnostic for type diagnoser");
1828
2.43k
    }
1829
1830
4.90k
    void diagnose(Sema &S, SourceLocation Loc, QualType T) override {
1831
4.90k
      const SemaDiagnosticBuilder &DB = S.Diag(Loc, DiagID);
1832
4.90k
      emit(DB, std::index_sequence_for<Ts...>());
1833
4.90k
      DB << T;
1834
4.90k
    }
clang::Sema::BoundTypeDiagnoser<>::diagnose(clang::Sema&, clang::SourceLocation, clang::QualType)
Line
Count
Source
1830
2.69k
    void diagnose(Sema &S, SourceLocation Loc, QualType T) override {
1831
2.69k
      const SemaDiagnosticBuilder &DB = S.Diag(Loc, DiagID);
1832
2.69k
      emit(DB, std::index_sequence_for<Ts...>());
1833
2.69k
      DB << T;
1834
2.69k
    }
clang::Sema::BoundTypeDiagnoser<clang::Sema::AbstractDiagSelID>::diagnose(clang::Sema&, clang::SourceLocation, clang::QualType)
Line
Count
Source
1830
1.84k
    void diagnose(Sema &S, SourceLocation Loc, QualType T) override {
1831
1.84k
      const SemaDiagnosticBuilder &DB = S.Diag(Loc, DiagID);
1832
1.84k
      emit(DB, std::index_sequence_for<Ts...>());
1833
1.84k
      DB << T;
1834
1.84k
    }
Unexecuted instantiation: clang::Sema::BoundTypeDiagnoser<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::diagnose(clang::Sema&, clang::SourceLocation, clang::QualType)
clang::Sema::BoundTypeDiagnoser<unsigned int, clang::SourceRange, bool, bool>::diagnose(clang::Sema&, clang::SourceLocation, clang::QualType)
Line
Count
Source
1830
53
    void diagnose(Sema &S, SourceLocation Loc, QualType T) override {
1831
53
      const SemaDiagnosticBuilder &DB = S.Diag(Loc, DiagID);
1832
53
      emit(DB, std::index_sequence_for<Ts...>());
1833
53
      DB << T;
1834
53
    }
clang::Sema::BoundTypeDiagnoser<clang::DeclarationName, clang::IdentifierInfo*, clang::SourceRange>::diagnose(clang::Sema&, clang::SourceLocation, clang::QualType)
Line
Count
Source
1830
5
    void diagnose(Sema &S, SourceLocation Loc, QualType T) override {
1831
5
      const SemaDiagnosticBuilder &DB = S.Diag(Loc, DiagID);
1832
5
      emit(DB, std::index_sequence_for<Ts...>());
1833
5
      DB << T;
1834
5
    }
clang::Sema::BoundTypeDiagnoser<bool>::diagnose(clang::Sema&, clang::SourceLocation, clang::QualType)
Line
Count
Source
1830
19
    void diagnose(Sema &S, SourceLocation Loc, QualType T) override {
1831
19
      const SemaDiagnosticBuilder &DB = S.Diag(Loc, DiagID);
1832
19
      emit(DB, std::index_sequence_for<Ts...>());
1833
19
      DB << T;
1834
19
    }
clang::Sema::BoundTypeDiagnoser<int, clang::SourceRange>::diagnose(clang::Sema&, clang::SourceLocation, clang::QualType)
Line
Count
Source
1830
16
    void diagnose(Sema &S, SourceLocation Loc, QualType T) override {
1831
16
      const SemaDiagnosticBuilder &DB = S.Diag(Loc, DiagID);
1832
16
      emit(DB, std::index_sequence_for<Ts...>());
1833
16
      DB << T;
1834
16
    }
clang::Sema::BoundTypeDiagnoser<clang::DeclarationName>::diagnose(clang::Sema&, clang::SourceLocation, clang::QualType)
Line
Count
Source
1830
6
    void diagnose(Sema &S, SourceLocation Loc, QualType T) override {
1831
6
      const SemaDiagnosticBuilder &DB = S.Diag(Loc, DiagID);
1832
6
      emit(DB, std::index_sequence_for<Ts...>());
1833
6
      DB << T;
1834
6
    }
Unexecuted instantiation: clang::Sema::BoundTypeDiagnoser<char const*, clang::SourceRange>::diagnose(clang::Sema&, clang::SourceLocation, clang::QualType)
clang::Sema::BoundTypeDiagnoser<char const*, int>::diagnose(clang::Sema&, clang::SourceLocation, clang::QualType)
Line
Count
Source
1830
3
    void diagnose(Sema &S, SourceLocation Loc, QualType T) override {
1831
3
      const SemaDiagnosticBuilder &DB = S.Diag(Loc, DiagID);
1832
3
      emit(DB, std::index_sequence_for<Ts...>());
1833
3
      DB << T;
1834
3
    }
clang::Sema::BoundTypeDiagnoser<clang::TypeLoc>::diagnose(clang::Sema&, clang::SourceLocation, clang::QualType)
Line
Count
Source
1830
12
    void diagnose(Sema &S, SourceLocation Loc, QualType T) override {
1831
12
      const SemaDiagnosticBuilder &DB = S.Diag(Loc, DiagID);
1832
12
      emit(DB, std::index_sequence_for<Ts...>());
1833
12
      DB << T;
1834
12
    }
clang::Sema::BoundTypeDiagnoser<clang::DeclarationName, clang::SourceRange>::diagnose(clang::Sema&, clang::SourceLocation, clang::QualType)
Line
Count
Source
1830
1
    void diagnose(Sema &S, SourceLocation Loc, QualType T) override {
1831
1
      const SemaDiagnosticBuilder &DB = S.Diag(Loc, DiagID);
1832
1
      emit(DB, std::index_sequence_for<Ts...>());
1833
1
      DB << T;
1834
1
    }
clang::Sema::BoundTypeDiagnoser<clang::DeclarationName, clang::Expr*>::diagnose(clang::Sema&, clang::SourceLocation, clang::QualType)
Line
Count
Source
1830
1
    void diagnose(Sema &S, SourceLocation Loc, QualType T) override {
1831
1
      const SemaDiagnosticBuilder &DB = S.Diag(Loc, DiagID);
1832
1
      emit(DB, std::index_sequence_for<Ts...>());
1833
1
      DB << T;
1834
1
    }
clang::Sema::BoundTypeDiagnoser<clang::SourceRange>::diagnose(clang::Sema&, clang::SourceLocation, clang::QualType)
Line
Count
Source
1830
201
    void diagnose(Sema &S, SourceLocation Loc, QualType T) override {
1831
201
      const SemaDiagnosticBuilder &DB = S.Diag(Loc, DiagID);
1832
201
      emit(DB, std::index_sequence_for<Ts...>());
1833
201
      DB << T;
1834
201
    }
clang::Sema::BoundTypeDiagnoser<clang::QualType, clang::SourceRange>::diagnose(clang::Sema&, clang::SourceLocation, clang::QualType)
Line
Count
Source
1830
2
    void diagnose(Sema &S, SourceLocation Loc, QualType T) override {
1831
2
      const SemaDiagnosticBuilder &DB = S.Diag(Loc, DiagID);
1832
2
      emit(DB, std::index_sequence_for<Ts...>());
1833
2
      DB << T;
1834
2
    }
clang::Sema::BoundTypeDiagnoser<clang::Expr*>::diagnose(clang::Sema&, clang::SourceLocation, clang::QualType)
Line
Count
Source
1830
40
    void diagnose(Sema &S, SourceLocation Loc, QualType T) override {
1831
40
      const SemaDiagnosticBuilder &DB = S.Diag(Loc, DiagID);
1832
40
      emit(DB, std::index_sequence_for<Ts...>());
1833
40
      DB << T;
1834
40
    }
clang::Sema::BoundTypeDiagnoser<clang::QualType>::diagnose(clang::Sema&, clang::SourceLocation, clang::QualType)
Line
Count
Source
1830
4
    void diagnose(Sema &S, SourceLocation Loc, QualType T) override {
1831
4
      const SemaDiagnosticBuilder &DB = S.Diag(Loc, DiagID);
1832
4
      emit(DB, std::index_sequence_for<Ts...>());
1833
4
      DB << T;
1834
4
    }
clang::Sema::BoundTypeDiagnoser<int>::diagnose(clang::Sema&, clang::SourceLocation, clang::QualType)
Line
Count
Source
1830
1
    void diagnose(Sema &S, SourceLocation Loc, QualType T) override {
1831
1
      const SemaDiagnosticBuilder &DB = S.Diag(Loc, DiagID);
1832
1
      emit(DB, std::index_sequence_for<Ts...>());
1833
1
      DB << T;
1834
1
    }
1835
  };
1836
1837
  /// A derivative of BoundTypeDiagnoser for which the diagnostic's type
1838
  /// parameter is preceded by a 0/1 enum that is 1 if the type is sizeless.
1839
  /// For example, a diagnostic with no other parameters would generally have
1840
  /// the form "...%select{incomplete|sizeless}0 type %1...".
1841
  template <typename... Ts>
1842
  class SizelessTypeDiagnoser : public BoundTypeDiagnoser<Ts...> {
1843
  public:
1844
    SizelessTypeDiagnoser(unsigned DiagID, const Ts &... Args)
1845
7.93M
        : BoundTypeDiagnoser<Ts...>(DiagID, Args...) {}
clang::Sema::SizelessTypeDiagnoser<>::SizelessTypeDiagnoser(unsigned int)
Line
Count
Source
1845
7.50M
        : BoundTypeDiagnoser<Ts...>(DiagID, Args...) {}
clang::Sema::SizelessTypeDiagnoser<clang::DeclarationName>::SizelessTypeDiagnoser(unsigned int, clang::DeclarationName const&)
Line
Count
Source
1845
843
        : BoundTypeDiagnoser<Ts...>(DiagID, Args...) {}
clang::Sema::SizelessTypeDiagnoser<char const*, clang::SourceRange>::SizelessTypeDiagnoser(unsigned int, char const* const&, clang::SourceRange const&)
Line
Count
Source
1845
73.4k
        : BoundTypeDiagnoser<Ts...>(DiagID, Args...) {}
clang::Sema::SizelessTypeDiagnoser<clang::Expr*>::SizelessTypeDiagnoser(unsigned int, clang::Expr* const&)
Line
Count
Source
1845
260k
        : BoundTypeDiagnoser<Ts...>(DiagID, Args...) {}
clang::Sema::SizelessTypeDiagnoser<clang::SourceRange>::SizelessTypeDiagnoser(unsigned int, clang::SourceRange const&)
Line
Count
Source
1845
102k
        : BoundTypeDiagnoser<Ts...>(DiagID, Args...) {}
1846
1847
494
    void diagnose(Sema &S, SourceLocation Loc, QualType T) override {
1848
494
      const SemaDiagnosticBuilder &DB = S.Diag(Loc, this->DiagID);
1849
494
      this->emit(DB, std::index_sequence_for<Ts...>());
1850
494
      DB << T->isSizelessType() << T;
1851
494
    }
clang::Sema::SizelessTypeDiagnoser<>::diagnose(clang::Sema&, clang::SourceLocation, clang::QualType)
Line
Count
Source
1847
199
    void diagnose(Sema &S, SourceLocation Loc, QualType T) override {
1848
199
      const SemaDiagnosticBuilder &DB = S.Diag(Loc, this->DiagID);
1849
199
      this->emit(DB, std::index_sequence_for<Ts...>());
1850
199
      DB << T->isSizelessType() << T;
1851
199
    }
clang::Sema::SizelessTypeDiagnoser<clang::DeclarationName>::diagnose(clang::Sema&, clang::SourceLocation, clang::QualType)
Line
Count
Source
1847
8
    void diagnose(Sema &S, SourceLocation Loc, QualType T) override {
1848
8
      const SemaDiagnosticBuilder &DB = S.Diag(Loc, this->DiagID);
1849
8
      this->emit(DB, std::index_sequence_for<Ts...>());
1850
8
      DB << T->isSizelessType() << T;
1851
8
    }
clang::Sema::SizelessTypeDiagnoser<char const*, clang::SourceRange>::diagnose(clang::Sema&, clang::SourceLocation, clang::QualType)
Line
Count
Source
1847
144
    void diagnose(Sema &S, SourceLocation Loc, QualType T) override {
1848
144
      const SemaDiagnosticBuilder &DB = S.Diag(Loc, this->DiagID);
1849
144
      this->emit(DB, std::index_sequence_for<Ts...>());
1850
144
      DB << T->isSizelessType() << T;
1851
144
    }
clang::Sema::SizelessTypeDiagnoser<clang::Expr*>::diagnose(clang::Sema&, clang::SourceLocation, clang::QualType)
Line
Count
Source
1847
22
    void diagnose(Sema &S, SourceLocation Loc, QualType T) override {
1848
22
      const SemaDiagnosticBuilder &DB = S.Diag(Loc, this->DiagID);
1849
22
      this->emit(DB, std::index_sequence_for<Ts...>());
1850
22
      DB << T->isSizelessType() << T;
1851
22
    }
clang::Sema::SizelessTypeDiagnoser<clang::SourceRange>::diagnose(clang::Sema&, clang::SourceLocation, clang::QualType)
Line
Count
Source
1847
121
    void diagnose(Sema &S, SourceLocation Loc, QualType T) override {
1848
121
      const SemaDiagnosticBuilder &DB = S.Diag(Loc, this->DiagID);
1849
121
      this->emit(DB, std::index_sequence_for<Ts...>());
1850
121
      DB << T->isSizelessType() << T;
1851
121
    }
1852
  };
1853
1854
  enum class CompleteTypeKind {
1855
    /// Apply the normal rules for complete types.  In particular,
1856
    /// treat all sizeless types as incomplete.
1857
    Normal,
1858
1859
    /// Relax the normal rules for complete types so that they include
1860
    /// sizeless built-in types.
1861
    AcceptSizeless,
1862
1863
    // FIXME: Eventually we should flip the default to Normal and opt in
1864
    // to AcceptSizeless rather than opt out of it.
1865
    Default = AcceptSizeless
1866
  };
1867
1868
private:
1869
  /// Methods for marking which expressions involve dereferencing a pointer
1870
  /// marked with the 'noderef' attribute. Expressions are checked bottom up as
1871
  /// they are parsed, meaning that a noderef pointer may not be accessed. For
1872
  /// example, in `&*p` where `p` is a noderef pointer, we will first parse the
1873
  /// `*p`, but need to check that `address of` is called on it. This requires
1874
  /// keeping a container of all pending expressions and checking if the address
1875
  /// of them are eventually taken.
1876
  void CheckSubscriptAccessOfNoDeref(const ArraySubscriptExpr *E);
1877
  void CheckAddressOfNoDeref(const Expr *E);
1878
  void CheckMemberAccessOfNoDeref(const MemberExpr *E);
1879
1880
  bool RequireCompleteTypeImpl(SourceLocation Loc, QualType T,
1881
                               CompleteTypeKind Kind, TypeDiagnoser *Diagnoser);
1882
1883
  struct ModuleScope {
1884
    SourceLocation BeginLoc;
1885
    clang::Module *Module = nullptr;
1886
    bool ModuleInterface = false;
1887
    bool ImplicitGlobalModuleFragment = false;
1888
    VisibleModuleSet OuterVisibleModules;
1889
  };
1890
  /// The modules we're currently parsing.
1891
  llvm::SmallVector<ModuleScope, 16> ModuleScopes;
1892
1893
  /// Namespace definitions that we will export when they finish.
1894
  llvm::SmallPtrSet<const NamespaceDecl*, 8> DeferredExportedNamespaces;
1895
1896
  /// Get the module whose scope we are currently within.
1897
790k
  Module *getCurrentModule() const {
1898
620k
    return ModuleScopes.empty() ? nullptr : 
ModuleScopes.back().Module169k
;
1899
790k
  }
1900
1901
  VisibleModuleSet VisibleModules;
1902
1903
public:
1904
  /// Get the module owning an entity.
1905
126k
  Module *getOwningModule(const Decl *Entity) {
1906
126k
    return Entity->getOwningModule();
1907
126k
  }
1908
1909
  /// Make a merged definition of an existing hidden definition \p ND
1910
  /// visible at the specified location.
1911
  void makeMergedDefinitionVisible(NamedDecl *ND);
1912
1913
  bool isModuleVisible(const Module *M, bool ModulePrivate = false);
1914
1915
  // When loading a non-modular PCH files, this is used to restore module
1916
  // visibility.
1917
86
  void makeModuleVisible(Module *Mod, SourceLocation ImportLoc) {
1918
86
    VisibleModules.setVisible(Mod, ImportLoc);
1919
86
  }
1920
1921
  /// Determine whether a declaration is visible to name lookup.
1922
28.4M
  bool isVisible(const NamedDecl *D) {
1923
28.4M
    return D->isUnconditionallyVisible() || 
isVisibleSlow(D)44.6k
;
1924
28.4M
  }
1925
1926
  /// Determine whether any declaration of an entity is visible.
1927
  bool
1928
  hasVisibleDeclaration(const NamedDecl *D,
1929
145k
                        llvm::SmallVectorImpl<Module *> *Modules = nullptr) {
1930
145k
    return isVisible(D) || 
hasVisibleDeclarationSlow(D, Modules)71
;
1931
145k
  }
1932
  bool hasVisibleDeclarationSlow(const NamedDecl *D,
1933
                                 llvm::SmallVectorImpl<Module *> *Modules);
1934
1935
  bool hasVisibleMergedDefinition(NamedDecl *Def);
1936
  bool hasMergedDefinitionInCurrentModule(NamedDecl *Def);
1937
1938
  /// Determine if \p D and \p Suggested have a structurally compatible
1939
  /// layout as described in C11 6.2.7/1.
1940
  bool hasStructuralCompatLayout(Decl *D, Decl *Suggested);
1941
1942
  /// Determine if \p D has a visible definition. If not, suggest a declaration
1943
  /// that should be made visible to expose the definition.
1944
  bool hasVisibleDefinition(NamedDecl *D, NamedDecl **Suggested,
1945
                            bool OnlyNeedComplete = false);
1946
6.38k
  bool hasVisibleDefinition(const NamedDecl *D) {
1947
6.38k
    NamedDecl *Hidden;
1948
6.38k
    return hasVisibleDefinition(const_cast<NamedDecl*>(D), &Hidden);
1949
6.38k
  }
1950
1951
  /// Determine if the template parameter \p D has a visible default argument.
1952
  bool
1953
  hasVisibleDefaultArgument(const NamedDecl *D,
1954
                            llvm::SmallVectorImpl<Module *> *Modules = nullptr);
1955
1956
  /// Determine if there is a visible declaration of \p D that is an explicit
1957
  /// specialization declaration for a specialization of a template. (For a
1958
  /// member specialization, use hasVisibleMemberSpecialization.)
1959
  bool hasVisibleExplicitSpecialization(
1960
      const NamedDecl *D, llvm::SmallVectorImpl<Module *> *Modules = nullptr);
1961
1962
  /// Determine if there is a visible declaration of \p D that is a member
1963
  /// specialization declaration (as opposed to an instantiated declaration).
1964
  bool hasVisibleMemberSpecialization(
1965
      const NamedDecl *D, llvm::SmallVectorImpl<Module *> *Modules = nullptr);
1966
1967
  /// Determine if \p A and \p B are equivalent internal linkage declarations
1968
  /// from different modules, and thus an ambiguity error can be downgraded to
1969
  /// an extension warning.
1970
  bool isEquivalentInternalLinkageDeclaration(const NamedDecl *A,
1971
                                              const NamedDecl *B);
1972
  void diagnoseEquivalentInternalLinkageDeclarations(
1973
      SourceLocation Loc, const NamedDecl *D,
1974
      ArrayRef<const NamedDecl *> Equiv);
1975
1976
  bool isUsualDeallocationFunction(const CXXMethodDecl *FD);
1977
1978
  bool isCompleteType(SourceLocation Loc, QualType T,
1979
15.4M
                      CompleteTypeKind Kind = CompleteTypeKind::Default) {
1980
15.4M
    return !RequireCompleteTypeImpl(Loc, T, Kind, nullptr);
1981
15.4M
  }
1982
  bool RequireCompleteType(SourceLocation Loc, QualType T,
1983
                           CompleteTypeKind Kind, TypeDiagnoser &Diagnoser);
1984
  bool RequireCompleteType(SourceLocation Loc, QualType T,
1985
                           CompleteTypeKind Kind, unsigned DiagID);
1986
1987
  bool RequireCompleteType(SourceLocation Loc, QualType T,
1988
8.64M
                           TypeDiagnoser &Diagnoser) {
1989
8.64M
    return RequireCompleteType(Loc, T, CompleteTypeKind::Default, Diagnoser);
1990
8.64M
  }
1991
15.0M
  bool RequireCompleteType(SourceLocation Loc, QualType T, unsigned DiagID) {
1992
15.0M
    return RequireCompleteType(Loc, T, CompleteTypeKind::Default, DiagID);
1993
15.0M
  }
1994
1995
  template <typename... Ts>
1996
  bool RequireCompleteType(SourceLocation Loc, QualType T, unsigned DiagID,
1997
8.63M
                           const Ts &...Args) {
1998
8.63M
    BoundTypeDiagnoser<Ts...> Diagnoser(DiagID, Args...);
1999
8.63M
    return RequireCompleteType(Loc, T, Diagnoser);
2000
8.63M
  }
bool clang::Sema::RequireCompleteType<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(clang::SourceLocation, clang::QualType, unsigned int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
Line
Count
Source
1997
2
                           const Ts &...Args) {
1998
2
    BoundTypeDiagnoser<Ts...> Diagnoser(DiagID, Args...);
1999
2
    return RequireCompleteType(Loc, T, Diagnoser);
2000
2
  }
bool clang::Sema::RequireCompleteType<clang::DeclarationName>(clang::SourceLocation, clang::QualType, unsigned int, clang::DeclarationName const&)
Line
Count
Source
1997
2.84k
                           const Ts &...Args) {
1998
2.84k
    BoundTypeDiagnoser<Ts...> Diagnoser(DiagID, Args...);
1999
2.84k
    return RequireCompleteType(Loc, T, Diagnoser);
2000
2.84k
  }
bool clang::Sema::RequireCompleteType<clang::DeclarationName, clang::IdentifierInfo*, clang::SourceRange>(clang::SourceLocation, clang::QualType, unsigned int, clang::DeclarationName const&, clang::IdentifierInfo* const&, clang::SourceRange const&)
Line
Count
Source
1997
81.9k
                           const Ts &...Args) {
1998
81.9k
    BoundTypeDiagnoser<Ts...> Diagnoser(DiagID, Args...);
1999
81.9k
    return RequireCompleteType(Loc, T, Diagnoser);
2000
81.9k
  }
bool clang::Sema::RequireCompleteType<bool>(clang::SourceLocation, clang::QualType, unsigned int, bool const&)
Line
Count
Source
1997
53.5k
                           const Ts &...Args) {
1998
53.5k
    BoundTypeDiagnoser<Ts...> Diagnoser(DiagID, Args...);
1999
53.5k
    return RequireCompleteType(Loc, T, Diagnoser);
2000
53.5k
  }
bool clang::Sema::RequireCompleteType<int, clang::SourceRange>(clang::SourceLocation, clang::QualType, unsigned int, int const&, clang::SourceRange const&)
Line
Count
Source
1997
766
                           const Ts &...Args) {
1998
766
    BoundTypeDiagnoser<Ts...> Diagnoser(DiagID, Args...);
1999
766
    return RequireCompleteType(Loc, T, Diagnoser);
2000
766
  }
bool clang::Sema::RequireCompleteType<char const*, int>(clang::SourceLocation, clang::QualType, unsigned int, char const* const&, int const&)
Line
Count
Source
1997
63
                           const Ts &...Args) {
1998
63
    BoundTypeDiagnoser<Ts...> Diagnoser(DiagID, Args...);
1999
63
    return RequireCompleteType(Loc, T, Diagnoser);
2000
63
  }
bool clang::Sema::RequireCompleteType<clang::TypeLoc>(clang::SourceLocation, clang::QualType, unsigned int, clang::TypeLoc const&)
Line
Count
Source
1997
1.09k
                           const Ts &...Args) {
1998
1.09k
    BoundTypeDiagnoser<Ts...> Diagnoser(DiagID, Args...);
1999
1.09k
    return RequireCompleteType(Loc, T, Diagnoser);
2000
1.09k
  }
bool clang::Sema::RequireCompleteType<clang::DeclarationName, clang::SourceRange>(clang::SourceLocation, clang::QualType, unsigned int, clang::DeclarationName const&, clang::SourceRange const&)
Line
Count
Source
1997
2.19k
                           const Ts &...Args) {
1998
2.19k
    BoundTypeDiagnoser<Ts...> Diagnoser(DiagID, Args...);
1999
2.19k
    return RequireCompleteType(Loc, T, Diagnoser);
2000
2.19k
  }
bool clang::Sema::RequireCompleteType<clang::DeclarationName, clang::Expr*>(clang::SourceLocation, clang::QualType, unsigned int, clang::DeclarationName const&, clang::Expr* const&)
Line
Count
Source
1997
1
                           const Ts &...Args) {
1998
1
    BoundTypeDiagnoser<Ts...> Diagnoser(DiagID, Args...);
1999
1
    return RequireCompleteType(Loc, T, Diagnoser);
2000
1
  }
bool clang::Sema::RequireCompleteType<clang::SourceRange>(clang::SourceLocation, clang::QualType, unsigned int, clang::SourceRange const&)
Line
Count
Source
1997
2.98M
                           const Ts &...Args) {
1998
2.98M
    BoundTypeDiagnoser<Ts...> Diagnoser(DiagID, Args...);
1999
2.98M
    return RequireCompleteType(Loc, T, Diagnoser);
2000
2.98M
  }
bool clang::Sema::RequireCompleteType<clang::QualType, clang::SourceRange>(clang::SourceLocation, clang::QualType, unsigned int, clang::QualType const&, clang::SourceRange const&)
Line
Count
Source
1997
666
                           const Ts &...Args) {
1998
666
    BoundTypeDiagnoser<Ts...> Diagnoser(DiagID, Args...);
1999
666
    return RequireCompleteType(Loc, T, Diagnoser);
2000
666
  }
bool clang::Sema::RequireCompleteType<clang::Expr*>(clang::SourceLocation, clang::QualType, unsigned int, clang::Expr* const&)
Line
Count
Source
1997
5.50M
                           const Ts &...Args) {
1998
5.50M
    BoundTypeDiagnoser<Ts...> Diagnoser(DiagID, Args...);
1999
5.50M
    return RequireCompleteType(Loc, T, Diagnoser);
2000
5.50M
  }
bool clang::Sema::RequireCompleteType<clang::QualType>(clang::SourceLocation, clang::QualType, unsigned int, clang::QualType const&)
Line
Count
Source
1997
93
                           const Ts &...Args) {
1998
93
    BoundTypeDiagnoser<Ts...> Diagnoser(DiagID, Args...);
1999
93
    return RequireCompleteType(Loc, T, Diagnoser);
2000
93
  }
bool clang::Sema::RequireCompleteType<int>(clang::SourceLocation, clang::QualType, unsigned int, int const&)
Line
Count
Source
1997
2.43k
                           const Ts &...Args) {
1998
2.43k
    BoundTypeDiagnoser<Ts...> Diagnoser(DiagID, Args...);
1999
2.43k
    return RequireCompleteType(Loc, T, Diagnoser);
2000
2.43k
  }
2001
2002
  template <typename... Ts>
2003
  bool RequireCompleteSizedType(SourceLocation Loc, QualType T, unsigned DiagID,
2004
7.92M
                                const Ts &... Args) {
2005
7.92M
    SizelessTypeDiagnoser<Ts...> Diagnoser(DiagID, Args...);
2006
7.92M
    return RequireCompleteType(Loc, T, CompleteTypeKind::Normal, Diagnoser);
2007
7.92M
  }
bool clang::Sema::RequireCompleteSizedType<>(clang::SourceLocation, clang::QualType, unsigned int)
Line
Count
Source
2004
7.50M
                                const Ts &... Args) {
2005
7.50M
    SizelessTypeDiagnoser<Ts...> Diagnoser(DiagID, Args...);
2006
7.50M
    return RequireCompleteType(Loc, T, CompleteTypeKind::Normal, Diagnoser);
2007
7.50M
  }
bool clang::Sema::RequireCompleteSizedType<clang::DeclarationName>(clang::SourceLocation, clang::QualType, unsigned int, clang::DeclarationName const&)
Line
Count
Source
2004
843
                                const Ts &... Args) {
2005
843
    SizelessTypeDiagnoser<Ts...> Diagnoser(DiagID, Args...);
2006
843
    return RequireCompleteType(Loc, T, CompleteTypeKind::Normal, Diagnoser);
2007
843
  }
bool clang::Sema::RequireCompleteSizedType<char const*, clang::SourceRange>(clang::SourceLocation, clang::QualType, unsigned int, char const* const&, clang::SourceRange const&)
Line
Count
Source
2004
61.4k
                                const Ts &... Args) {
2005
61.4k
    SizelessTypeDiagnoser<Ts...> Diagnoser(DiagID, Args...);
2006
61.4k
    return RequireCompleteType(Loc, T, CompleteTypeKind::Normal, Diagnoser);
2007
61.4k
  }
bool clang::Sema::RequireCompleteSizedType<clang::Expr*>(clang::SourceLocation, clang::QualType, unsigned int, clang::Expr* const&)
Line
Count
Source
2004
260k
                                const Ts &... Args) {
2005
260k
    SizelessTypeDiagnoser<Ts...> Diagnoser(DiagID, Args...);
2006
260k
    return RequireCompleteType(Loc, T, CompleteTypeKind::Normal, Diagnoser);
2007
260k
  }
bool clang::Sema::RequireCompleteSizedType<clang::SourceRange>(clang::SourceLocation, clang::QualType, unsigned int, clang::SourceRange const&)
Line
Count
Source
2004
102k
                                const Ts &... Args) {
2005
102k
    SizelessTypeDiagnoser<Ts...> Diagnoser(DiagID, Args...);
2006
102k
    return RequireCompleteType(Loc, T, CompleteTypeKind::Normal, Diagnoser);
2007
102k
  }
2008
2009
  void completeExprArrayBound(Expr *E);
2010
  bool RequireCompleteExprType(Expr *E, CompleteTypeKind Kind,
2011
                               TypeDiagnoser &Diagnoser);
2012
  bool RequireCompleteExprType(Expr *E, unsigned DiagID);
2013
2014
  template <typename... Ts>
2015
  bool RequireCompleteExprType(Expr *E, unsigned DiagID, const Ts &...Args) {
2016
    BoundTypeDiagnoser<Ts...> Diagnoser(DiagID, Args...);
2017
    return RequireCompleteExprType(E, CompleteTypeKind::Default, Diagnoser);
2018
  }
2019
2020
  template <typename... Ts>
2021
  bool RequireCompleteSizedExprType(Expr *E, unsigned DiagID,
2022
11.9k
                                    const Ts &... Args) {
2023
11.9k
    SizelessTypeDiagnoser<Ts...> Diagnoser(DiagID, Args...);
2024
11.9k
    return RequireCompleteExprType(E, CompleteTypeKind::Normal, Diagnoser);
2025
11.9k
  }
2026
2027
  bool RequireLiteralType(SourceLocation Loc, QualType T,
2028
                          TypeDiagnoser &Diagnoser);
2029
  bool RequireLiteralType(SourceLocation Loc, QualType T, unsigned DiagID);
2030
2031
  template <typename... Ts>
2032
  bool RequireLiteralType(SourceLocation Loc, QualType T, unsigned DiagID,
2033
99.4k
                          const Ts &...Args) {
2034
99.4k
    BoundTypeDiagnoser<Ts...> Diagnoser(DiagID, Args...);
2035
99.4k
    return RequireLiteralType(Loc, T, Diagnoser);
2036
99.4k
  }
bool clang::Sema::RequireLiteralType<bool>(clang::SourceLocation, clang::QualType, unsigned int, bool const&)
Line
Count
Source
2033
59.7k
                          const Ts &...Args) {
2034
59.7k
    BoundTypeDiagnoser<Ts...> Diagnoser(DiagID, Args...);
2035
59.7k
    return RequireLiteralType(Loc, T, Diagnoser);
2036
59.7k
  }
bool clang::Sema::RequireLiteralType<unsigned int, clang::SourceRange, bool, bool>(clang::SourceLocation, clang::QualType, unsigned int, unsigned int const&, clang::SourceRange const&, bool const&, bool const&)
Line
Count
Source
2033
39.6k
                          const Ts &...Args) {
2034
39.6k
    BoundTypeDiagnoser<Ts...> Diagnoser(DiagID, Args...);
2035
39.6k
    return RequireLiteralType(Loc, T, Diagnoser);
2036
39.6k
  }
2037
2038
  QualType getElaboratedType(ElaboratedTypeKeyword Keyword,
2039
                             const CXXScopeSpec &SS, QualType T,
2040
                             TagDecl *OwnedTagDecl = nullptr);
2041
2042
  QualType BuildTypeofExprType(Expr *E, SourceLocation Loc);
2043
  /// If AsUnevaluated is false, E is treated as though it were an evaluated
2044
  /// context, such as when building a type for decltype(auto).
2045
  QualType BuildDecltypeType(Expr *E, SourceLocation Loc,
2046
                             bool AsUnevaluated = true);
2047
  QualType BuildUnaryTransformType(QualType BaseType,
2048
                                   UnaryTransformType::UTTKind UKind,
2049
                                   SourceLocation Loc);
2050
2051
  //===--------------------------------------------------------------------===//
2052
  // Symbol table / Decl tracking callbacks: SemaDecl.cpp.
2053
  //
2054
2055
  struct SkipBodyInfo {
2056
    SkipBodyInfo()
2057
        : ShouldSkip(false), CheckSameAsPrevious(false), Previous(nullptr),
2058
5.63M
          New(nullptr) {}
2059
    bool ShouldSkip;
2060
    bool CheckSameAsPrevious;
2061
    NamedDecl *Previous;
2062
    NamedDecl *New;
2063
  };
2064
2065
  DeclGroupPtrTy ConvertDeclToDeclGroup(Decl *Ptr, Decl *OwnedType = nullptr);
2066
2067
  void DiagnoseUseOfUnimplementedSelectors();
2068
2069
  bool isSimpleTypeSpecifier(tok::TokenKind Kind) const;
2070
2071
  ParsedType getTypeName(const IdentifierInfo &II, SourceLocation NameLoc,
2072
                         Scope *S, CXXScopeSpec *SS = nullptr,
2073
                         bool isClassName = false, bool HasTrailingDot = false,
2074
                         ParsedType ObjectType = nullptr,
2075
                         bool IsCtorOrDtorName = false,
2076
                         bool WantNontrivialTypeSourceInfo = false,
2077
                         bool IsClassTemplateDeductionContext = true,
2078
                         IdentifierInfo **CorrectedII = nullptr);
2079
  TypeSpecifierType isTagName(IdentifierInfo &II, Scope *S);
2080
  bool isMicrosoftMissingTypename(const CXXScopeSpec *SS, Scope *S);
2081
  void DiagnoseUnknownTypeName(IdentifierInfo *&II,
2082
                               SourceLocation IILoc,
2083
                               Scope *S,
2084
                               CXXScopeSpec *SS,
2085
                               ParsedType &SuggestedType,
2086
                               bool IsTemplateName = false);
2087
2088
  /// Attempt to behave like MSVC in situations where lookup of an unqualified
2089
  /// type name has failed in a dependent context. In these situations, we
2090
  /// automatically form a DependentTypeName that will retry lookup in a related
2091
  /// scope during instantiation.
2092
  ParsedType ActOnMSVCUnknownTypeName(const IdentifierInfo &II,
2093
                                      SourceLocation NameLoc,
2094
                                      bool IsTemplateTypeArg);
2095
2096
  /// Describes the result of the name lookup and resolution performed
2097
  /// by \c ClassifyName().
2098
  enum NameClassificationKind {
2099
    /// This name is not a type or template in this context, but might be
2100
    /// something else.
2101
    NC_Unknown,
2102
    /// Classification failed; an error has been produced.
2103
    NC_Error,
2104
    /// The name has been typo-corrected to a keyword.
2105
    NC_Keyword,
2106
    /// The name was classified as a type.
2107
    NC_Type,
2108
    /// The name was classified as a specific non-type, non-template
2109
    /// declaration. ActOnNameClassifiedAsNonType should be called to
2110
    /// convert the declaration to an expression.
2111
    NC_NonType,
2112
    /// The name was classified as an ADL-only function name.
2113
    /// ActOnNameClassifiedAsUndeclaredNonType should be called to convert the
2114
    /// result to an expression.
2115
    NC_UndeclaredNonType,
2116
    /// The name denotes a member of a dependent type that could not be
2117
    /// resolved. ActOnNameClassifiedAsDependentNonType should be called to
2118
    /// convert the result to an expression.
2119
    NC_DependentNonType,
2120
    /// The name was classified as an overload set, and an expression
2121
    /// representing that overload set has been formed.
2122
    /// ActOnNameClassifiedAsOverloadSet should be called to form a suitable
2123
    /// expression referencing the overload set.
2124
    NC_OverloadSet,
2125
    /// The name was classified as a template whose specializations are types.
2126
    NC_TypeTemplate,
2127
    /// The name was classified as a variable template name.
2128
    NC_VarTemplate,
2129
    /// The name was classified as a function template name.
2130
    NC_FunctionTemplate,
2131
    /// The name was classified as an ADL-only function template name.
2132
    NC_UndeclaredTemplate,
2133
    /// The name was classified as a concept name.
2134
    NC_Concept,
2135
  };
2136
2137
  class NameClassification {
2138
    NameClassificationKind Kind;
2139
    union {
2140
      ExprResult Expr;
2141
      NamedDecl *NonTypeDecl;
2142
      TemplateName Template;
2143
      ParsedType Type;
2144
    };
2145
2146
2.37M
    explicit NameClassification(NameClassificationKind Kind) : Kind(Kind) {}
2147
2148
  public:
2149
4.37M
    NameClassification(ParsedType Type) : Kind(NC_Type), Type(Type) {}
2150
2151
17
    NameClassification(const IdentifierInfo *Keyword) : Kind(NC_Keyword) {}
2152
2153
40
    static NameClassification Error() {
2154
40
      return NameClassification(NC_Error);
2155
40
    }
2156
2157
8.12k
    static NameClassification Unknown() {
2158
8.12k
      return NameClassification(NC_Unknown);
2159
8.12k
    }
2160
2161
610k
    static NameClassification OverloadSet(ExprResult E) {
2162
610k
      NameClassification Result(NC_OverloadSet);
2163
610k
      Result.Expr = E;
2164
610k
      return Result;
2165
610k
    }
2166
2167
1.74M
    static NameClassification NonType(NamedDecl *D) {
2168
1.74M
      NameClassification Result(NC_NonType);
2169
1.74M
      Result.NonTypeDecl = D;
2170
1.74M
      return Result;
2171
1.74M
    }
2172
2173
575
    static NameClassification UndeclaredNonType() {
2174
575
      return NameClassification(NC_UndeclaredNonType);
2175
575
    }
2176
2177
1.27k
    static NameClassification DependentNonType() {
2178
1.27k
      return NameClassification(NC_DependentNonType);
2179
1.27k
    }
2180
2181
3.74k
    static NameClassification TypeTemplate(TemplateName Name) {
2182
3.74k
      NameClassification Result(NC_TypeTemplate);
2183
3.74k
      Result.Template = Name;
2184
3.74k
      return Result;
2185
3.74k
    }
2186
2187
0
    static NameClassification VarTemplate(TemplateName Name) {
2188
0
      NameClassification Result(NC_VarTemplate);
2189
0
      Result.Template = Name;
2190
0
      return Result;
2191
0
    }
2192
2193
0
    static NameClassification FunctionTemplate(TemplateName Name) {
2194
0
      NameClassification Result(NC_FunctionTemplate);
2195
0
      Result.Template = Name;
2196
0
      return Result;
2197
0
    }
2198
2199
28
    static NameClassification Concept(TemplateName Name) {
2200
28
      NameClassification Result(NC_Concept);
2201
28
      Result.Template = Name;
2202
28
      return Result;
2203
28
    }
2204
2205
2
    static NameClassification UndeclaredTemplate(TemplateName Name) {
2206
2
      NameClassification Result(NC_UndeclaredTemplate);
2207
2
      Result.Template = Name;
2208
2
      return Result;
2209
2
    }
2210
2211
13.5M
    NameClassificationKind getKind() const { return Kind; }
2212
2213
610k
    ExprResult getExpression() const {
2214
610k
      assert(Kind == NC_OverloadSet);
2215
610k
      return Expr;
2216
610k
    }
2217
2218
4.37M
    ParsedType getType() const {
2219
4.37M
      assert(Kind == NC_Type);
2220
4.37M
      return Type;
2221
4.37M
    }
2222
2223
1.74M
    NamedDecl *getNonTypeDecl() const {
2224
1.74M
      assert(Kind == NC_NonType);
2225
1.74M
      return NonTypeDecl;
2226
1.74M
    }
2227
2228
28
    TemplateName getTemplateName() const {
2229
28
      assert(Kind == NC_TypeTemplate || Kind == NC_FunctionTemplate ||
2230
28
             Kind == NC_VarTemplate || Kind == NC_Concept ||
2231
28
             Kind == NC_UndeclaredTemplate);
2232
28
      return Template;
2233
28
    }
2234
2235
28
    TemplateNameKind getTemplateNameKind() const {
2236
28
      switch (Kind) {
2237
0
      case NC_TypeTemplate:
2238
0
        return TNK_Type_template;
2239
0
      case NC_FunctionTemplate:
2240
0
        return TNK_Function_template;
2241
0
      case NC_VarTemplate:
2242
0
        return TNK_Var_template;
2243
28
      case NC_Concept:
2244
28
        return TNK_Concept_template;
2245
0
      case NC_UndeclaredTemplate:
2246
0
        return TNK_Undeclared_template;
2247
0
      default:
2248
0
        llvm_unreachable("unsupported name classification.");
2249
28
      }
2250
28
    }
2251
  };
2252
2253
  /// Perform name lookup on the given name, classifying it based on
2254
  /// the results of name lookup and the following token.
2255
  ///
2256
  /// This routine is used by the parser to resolve identifiers and help direct
2257
  /// parsing. When the identifier cannot be found, this routine will attempt
2258
  /// to correct the typo and classify based on the resulting name.
2259
  ///
2260
  /// \param S The scope in which we're performing name lookup.
2261
  ///
2262
  /// \param SS The nested-name-specifier that precedes the name.
2263
  ///
2264
  /// \param Name The identifier. If typo correction finds an alternative name,
2265
  /// this pointer parameter will be updated accordingly.
2266
  ///
2267
  /// \param NameLoc The location of the identifier.
2268
  ///
2269
  /// \param NextToken The token following the identifier. Used to help
2270
  /// disambiguate the name.
2271
  ///
2272
  /// \param CCC The correction callback, if typo correction is desired.
2273
  NameClassification ClassifyName(Scope *S, CXXScopeSpec &SS,
2274
                                  IdentifierInfo *&Name, SourceLocation NameLoc,
2275
                                  const Token &NextToken,
2276
                                  CorrectionCandidateCallback *CCC = nullptr);
2277
2278
  /// Act on the result of classifying a name as an undeclared (ADL-only)
2279
  /// non-type declaration.
2280
  ExprResult ActOnNameClassifiedAsUndeclaredNonType(IdentifierInfo *Name,
2281
                                                    SourceLocation NameLoc);
2282
  /// Act on the result of classifying a name as an undeclared member of a
2283
  /// dependent base class.
2284
  ExprResult ActOnNameClassifiedAsDependentNonType(const CXXScopeSpec &SS,
2285
                                                   IdentifierInfo *Name,
2286
                                                   SourceLocation NameLoc,
2287
                                                   bool IsAddressOfOperand);
2288
  /// Act on the result of classifying a name as a specific non-type
2289
  /// declaration.
2290
  ExprResult ActOnNameClassifiedAsNonType(Scope *S, const CXXScopeSpec &SS,
2291
                                          NamedDecl *Found,
2292
                                          SourceLocation NameLoc,
2293
                                          const Token &NextToken);
2294
  /// Act on the result of classifying a name as an overload set.
2295
  ExprResult ActOnNameClassifiedAsOverloadSet(Scope *S, Expr *OverloadSet);
2296
2297
  /// Describes the detailed kind of a template name. Used in diagnostics.
2298
  enum class TemplateNameKindForDiagnostics {
2299
    ClassTemplate,
2300
    FunctionTemplate,
2301
    VarTemplate,
2302
    AliasTemplate,
2303
    TemplateTemplateParam,
2304
    Concept,
2305
    DependentTemplate
2306
  };
2307
  TemplateNameKindForDiagnostics
2308
  getTemplateNameKindForDiagnostics(TemplateName Name);
2309
2310
  /// Determine whether it's plausible that E was intended to be a
2311
  /// template-name.
2312
191k
  bool mightBeIntendedToBeTemplateName(ExprResult E, bool &Dependent) {
2313
191k
    if (!getLangOpts().CPlusPlus || 
E.isInvalid()177k
)
2314
13.9k
      return false;
2315
177k
    Dependent = false;
2316
177k
    if (auto *DRE = dyn_cast<DeclRefExpr>(E.get()))
2317
169k
      return !DRE->hasExplicitTemplateArgs();
2318
8.19k
    if (auto *ME = dyn_cast<MemberExpr>(E.get()))
2319
5.31k
      return !ME->hasExplicitTemplateArgs();
2320
2.87k
    Dependent = true;
2321
2.87k
    if (auto *DSDRE = dyn_cast<DependentScopeDeclRefExpr>(E.get()))
2322
14
      return !DSDRE->hasExplicitTemplateArgs();
2323
2.86k
    if (auto *DSME = dyn_cast<CXXDependentScopeMemberExpr>(E.get()))
2324
2.83k
      return !DSME->hasExplicitTemplateArgs();
2325
    // Any additional cases recognized here should also be handled by
2326
    // diagnoseExprIntendedAsTemplateName.
2327
27
    return false;
2328
27
  }
2329
  void diagnoseExprIntendedAsTemplateName(Scope *S, ExprResult TemplateName,
2330
                                          SourceLocation Less,
2331
                                          SourceLocation Greater);
2332
2333
  Decl *ActOnDeclarator(Scope *S, Declarator &D);
2334
2335
  NamedDecl *HandleDeclarator(Scope *S, Declarator &D,
2336
                              MultiTemplateParamsArg TemplateParameterLists);
2337
  void RegisterLocallyScopedExternCDecl(NamedDecl *ND, Scope *S);
2338
  bool DiagnoseClassNameShadow(DeclContext *DC, DeclarationNameInfo Info);
2339
  bool diagnoseQualifiedDeclaration(CXXScopeSpec &SS, DeclContext *DC,
2340
                                    DeclarationName Name, SourceLocation Loc,
2341
                                    bool IsTemplateId);
2342
  void
2343
  diagnoseIgnoredQualifiers(unsigned DiagID, unsigned Quals,
2344
                            SourceLocation FallbackLoc,
2345
                            SourceLocation ConstQualLoc = SourceLocation(),
2346
                            SourceLocation VolatileQualLoc = SourceLocation(),
2347
                            SourceLocation RestrictQualLoc = SourceLocation(),
2348
                            SourceLocation AtomicQualLoc = SourceLocation(),
2349
                            SourceLocation UnalignedQualLoc = SourceLocation());
2350
2351
  static bool adjustContextForLocalExternDecl(DeclContext *&DC);
2352
  void DiagnoseFunctionSpecifiers(const DeclSpec &DS);
2353
  NamedDecl *getShadowedDeclaration(const TypedefNameDecl *D,
2354
                                    const LookupResult &R);
2355
  NamedDecl *getShadowedDeclaration(const VarDecl *D, const LookupResult &R);
2356
  void CheckShadow(NamedDecl *D, NamedDecl *ShadowedDecl,
2357
                   const LookupResult &R);
2358
  void CheckShadow(Scope *S, VarDecl *D);
2359
2360
  /// Warn if 'E', which is an expression that is about to be modified, refers
2361
  /// to a shadowing declaration.
2362
  void CheckShadowingDeclModification(Expr *E, SourceLocation Loc);
2363
2364
  void DiagnoseShadowingLambdaDecls(const sema::LambdaScopeInfo *LSI);
2365
2366
private:
2367
  /// Map of current shadowing declarations to shadowed declarations. Warn if
2368
  /// it looks like the user is trying to modify the shadowing declaration.
2369
  llvm::DenseMap<const NamedDecl *, const NamedDecl *> ShadowingDecls;
2370
2371
public:
2372
  void CheckCastAlign(Expr *Op, QualType T, SourceRange TRange);
2373
  void handleTagNumbering(const TagDecl *Tag, Scope *TagScope);
2374
  void setTagNameForLinkagePurposes(TagDecl *TagFromDeclSpec,
2375
                                    TypedefNameDecl *NewTD);
2376
  void CheckTypedefForVariablyModifiedType(Scope *S, TypedefNameDecl *D);
2377
  NamedDecl* ActOnTypedefDeclarator(Scope* S, Declarator& D, DeclContext* DC,
2378
                                    TypeSourceInfo *TInfo,
2379
                                    LookupResult &Previous);
2380
  NamedDecl* ActOnTypedefNameDecl(Scope* S, DeclContext* DC, TypedefNameDecl *D,
2381
                                  LookupResult &Previous, bool &Redeclaration);
2382
  NamedDecl *ActOnVariableDeclarator(Scope *S, Declarator &D, DeclContext *DC,
2383
                                     TypeSourceInfo *TInfo,
2384
                                     LookupResult &Previous,
2385
                                     MultiTemplateParamsArg TemplateParamLists,
2386
                                     bool &AddToScope,
2387
                                     ArrayRef<BindingDecl *> Bindings = None);
2388
  NamedDecl *
2389
  ActOnDecompositionDeclarator(Scope *S, Declarator &D,
2390
                               MultiTemplateParamsArg TemplateParamLists);
2391
  // Returns true if the variable declaration is a redeclaration
2392
  bool CheckVariableDeclaration(VarDecl *NewVD, LookupResult &Previous);
2393
  void CheckVariableDeclarationType(VarDecl *NewVD);
2394
  bool DeduceVariableDeclarationType(VarDecl *VDecl, bool DirectInit,
2395
                                     Expr *Init);
2396
  void CheckCompleteVariableDeclaration(VarDecl *VD);
2397
  void CheckCompleteDecompositionDeclaration(DecompositionDecl *DD);
2398
  void MaybeSuggestAddingStaticToDecl(const FunctionDecl *D);
2399
2400
  NamedDecl* ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
2401
                                     TypeSourceInfo *TInfo,
2402
                                     LookupResult &Previous,
2403
                                     MultiTemplateParamsArg TemplateParamLists,
2404
                                     bool &AddToScope);
2405
  bool AddOverriddenMethods(CXXRecordDecl *DC, CXXMethodDecl *MD);
2406
2407
  enum class CheckConstexprKind {
2408
    /// Diagnose issues that are non-constant or that are extensions.
2409
    Diagnose,
2410
    /// Identify whether this function satisfies the formal rules for constexpr
2411
    /// functions in the current lanugage mode (with no extensions).
2412
    CheckValid
2413
  };
2414
2415
  bool CheckConstexprFunctionDefinition(const FunctionDecl *FD,
2416
                                        CheckConstexprKind Kind);
2417
2418
  void DiagnoseHiddenVirtualMethods(CXXMethodDecl *MD);
2419
  void FindHiddenVirtualMethods(CXXMethodDecl *MD,
2420
                          SmallVectorImpl<CXXMethodDecl*> &OverloadedMethods);
2421
  void NoteHiddenVirtualMethods(CXXMethodDecl *MD,
2422
                          SmallVectorImpl<CXXMethodDecl*> &OverloadedMethods);
2423
  // Returns true if the function declaration is a redeclaration
2424
  bool CheckFunctionDeclaration(Scope *S,
2425
                                FunctionDecl *NewFD, LookupResult &Previous,
2426
                                bool IsMemberSpecialization);
2427
  bool shouldLinkDependentDeclWithPrevious(Decl *D, Decl *OldDecl);
2428
  bool canFullyTypeCheckRedeclaration(ValueDecl *NewD, ValueDecl *OldD,
2429
                                      QualType NewT, QualType OldT);
2430
  void CheckMain(FunctionDecl *FD, const DeclSpec &D);
2431
  void CheckMSVCRTEntryPoint(FunctionDecl *FD);
2432
  Attr *getImplicitCodeSegOrSectionAttrForFunction(const FunctionDecl *FD,
2433
                                                   bool IsDefinition);
2434
  void CheckFunctionOrTemplateParamDeclarator(Scope *S, Declarator &D);
2435
  Decl *ActOnParamDeclarator(Scope *S, Declarator &D);
2436
  ParmVarDecl *BuildParmVarDeclForTypedef(DeclContext *DC,
2437
                                          SourceLocation Loc,
2438
                                          QualType T);
2439
  ParmVarDecl *CheckParameter(DeclContext *DC, SourceLocation StartLoc,
2440
                              SourceLocation NameLoc, IdentifierInfo *Name,
2441
                              QualType T, TypeSourceInfo *TSInfo,
2442
                              StorageClass SC);
2443
  void ActOnParamDefaultArgument(Decl *param,
2444
                                 SourceLocation EqualLoc,
2445
                                 Expr *defarg);
2446
  void ActOnParamUnparsedDefaultArgument(Decl *param, SourceLocation EqualLoc,
2447
                                         SourceLocation ArgLoc);
2448
  void ActOnParamDefaultArgumentError(Decl *param, SourceLocation EqualLoc);
2449
  ExprResult ConvertParamDefaultArgument(const ParmVarDecl *Param,
2450
                                         Expr *DefaultArg,
2451
                                         SourceLocation EqualLoc);
2452
  void SetParamDefaultArgument(ParmVarDecl *Param, Expr *DefaultArg,
2453
                               SourceLocation EqualLoc);
2454
2455
  // Contexts where using non-trivial C union types can be disallowed. This is
2456
  // passed to err_non_trivial_c_union_in_invalid_context.
2457
  enum NonTrivialCUnionContext {
2458
    // Function parameter.
2459
    NTCUC_FunctionParam,
2460
    // Function return.
2461
    NTCUC_FunctionReturn,
2462
    // Default-initialized object.
2463
    NTCUC_DefaultInitializedObject,
2464
    // Variable with automatic storage duration.
2465
    NTCUC_AutoVar,
2466
    // Initializer expression that might copy from another object.
2467
    NTCUC_CopyInit,
2468
    // Assignment.
2469
    NTCUC_Assignment,
2470
    // Compound literal.
2471
    NTCUC_CompoundLiteral,
2472
    // Block capture.
2473
    NTCUC_BlockCapture,
2474
    // lvalue-to-rvalue conversion of volatile type.
2475
    NTCUC_LValueToRValueVolatile,
2476
  };
2477
2478
  /// Emit diagnostics if the initializer or any of its explicit or
2479
  /// implicitly-generated subexpressions require copying or
2480
  /// default-initializing a type that is or contains a C union type that is
2481
  /// non-trivial to copy or default-initialize.
2482
  void checkNonTrivialCUnionInInitializer(const Expr *Init, SourceLocation Loc);
2483
2484
  // These flags are passed to checkNonTrivialCUnion.
2485
  enum NonTrivialCUnionKind {
2486
    NTCUK_Init = 0x1,
2487
    NTCUK_Destruct = 0x2,
2488
    NTCUK_Copy = 0x4,
2489
  };
2490
2491
  /// Emit diagnostics if a non-trivial C union type or a struct that contains
2492
  /// a non-trivial C union is used in an invalid context.
2493
  void checkNonTrivialCUnion(QualType QT, SourceLocation Loc,
2494
                             NonTrivialCUnionContext UseContext,
2495
                             unsigned NonTrivialKind);
2496
2497
  void AddInitializerToDecl(Decl *dcl, Expr *init, bool DirectInit);
2498
  void ActOnUninitializedDecl(Decl *dcl);
2499
  void ActOnInitializerError(Decl *Dcl);
2500
2501
  void ActOnPureSpecifier(Decl *D, SourceLocation PureSpecLoc);
2502
  void ActOnCXXForRangeDecl(Decl *D);
2503
  StmtResult ActOnCXXForRangeIdentifier(Scope *S, SourceLocation IdentLoc,
2504
                                        IdentifierInfo *Ident,
2505
                                        ParsedAttributes &Attrs,
2506
                                        SourceLocation AttrEnd);
2507
  void SetDeclDeleted(Decl *dcl, SourceLocation DelLoc);
2508
  void SetDeclDefaulted(Decl *dcl, SourceLocation DefaultLoc);
2509
  void CheckStaticLocalForDllExport(VarDecl *VD);
2510
  void FinalizeDeclaration(Decl *D);
2511
  DeclGroupPtrTy FinalizeDeclaratorGroup(Scope *S, const DeclSpec &DS,
2512
                                         ArrayRef<Decl *> Group);
2513
  DeclGroupPtrTy BuildDeclaratorGroup(MutableArrayRef<Decl *> Group);
2514
2515
  /// Should be called on all declarations that might have attached
2516
  /// documentation comments.
2517
  void ActOnDocumentableDecl(Decl *D);
2518
  void ActOnDocumentableDecls(ArrayRef<Decl *> Group);
2519
2520
  void ActOnFinishKNRParamDeclarations(Scope *S, Declarator &D,
2521
                                       SourceLocation LocAfterDecls);
2522
  void CheckForFunctionRedefinition(
2523
      FunctionDecl *FD, const FunctionDecl *EffectiveDefinition = nullptr,
2524
      SkipBodyInfo *SkipBody = nullptr);
2525
  Decl *ActOnStartOfFunctionDef(Scope *S, Declarator &D,
2526
                                MultiTemplateParamsArg TemplateParamLists,
2527
                                SkipBodyInfo *SkipBody = nullptr);
2528
  Decl *ActOnStartOfFunctionDef(Scope *S, Decl *D,
2529
                                SkipBodyInfo *SkipBody = nullptr);
2530
  void ActOnStartTrailingRequiresClause(Scope *S, Declarator &D);
2531
  ExprResult ActOnFinishTrailingRequiresClause(ExprResult ConstraintExpr);
2532
  void ActOnStartOfObjCMethodDef(Scope *S, Decl *D);
2533
7.50k
  bool isObjCMethodDecl(Decl *D) {
2534
7.50k
    return D && isa<ObjCMethodDecl>(D);
2535
7.50k
  }
2536
2537
  /// Determine whether we can delay parsing the body of a function or
2538
  /// function template until it is used, assuming we don't care about emitting
2539
  /// code for that function.
2540
  ///
2541
  /// This will be \c false if we may need the body of the function in the
2542
  /// middle of parsing an expression (where it's impractical to switch to
2543
  /// parsing a different function), for instance, if it's constexpr in C++11
2544
  /// or has an 'auto' return type in C++14. These cases are essentially bugs.
2545
  bool canDelayFunctionBody(const Declarator &D);
2546
2547
  /// Determine whether we can skip parsing the body of a function
2548
  /// definition, assuming we don't care about analyzing its body or emitting
2549
  /// code for that function.
2550
  ///
2551
  /// This will be \c false only if we may need the body of the function in
2552
  /// order to parse the rest of the program (for instance, if it is
2553
  /// \c constexpr in C++11 or has an 'auto' return type in C++14).
2554
  bool canSkipFunctionBody(Decl *D);
2555
2556
  void computeNRVO(Stmt *Body, sema::FunctionScopeInfo *Scope);
2557
  Decl *ActOnFinishFunctionBody(Decl *Decl, Stmt *Body);
2558
  Decl *ActOnFinishFunctionBody(Decl *Decl, Stmt *Body, bool IsInstantiation);
2559
  Decl *ActOnSkippedFunctionBody(Decl *Decl);
2560
  void ActOnFinishInlineFunctionDef(FunctionDecl *D);
2561
2562
  /// ActOnFinishDelayedAttribute - Invoked when we have finished parsing an
2563
  /// attribute for which parsing is delayed.
2564
  void ActOnFinishDelayedAttribute(Scope *S, Decl *D, ParsedAttributes &Attrs);
2565
2566
  /// Diagnose any unused parameters in the given sequence of
2567
  /// ParmVarDecl pointers.
2568
  void DiagnoseUnusedParameters(ArrayRef<ParmVarDecl *> Parameters);
2569
2570
  /// Diagnose whether the size of parameters or return value of a
2571
  /// function or obj-c method definition is pass-by-value and larger than a
2572
  /// specified threshold.
2573
  void
2574
  DiagnoseSizeOfParametersAndReturnValue(ArrayRef<ParmVarDecl *> Parameters,
2575
                                         QualType ReturnTy, NamedDecl *D);
2576
2577
  void DiagnoseInvalidJumps(Stmt *Body);
2578
  Decl *ActOnFileScopeAsmDecl(Expr *expr,
2579
                              SourceLocation AsmLoc,
2580
                              SourceLocation RParenLoc);
2581
2582
  /// Handle a C++11 empty-declaration and attribute-declaration.
2583
  Decl *ActOnEmptyDeclaration(Scope *S, const ParsedAttributesView &AttrList,
2584
                              SourceLocation SemiLoc);
2585
2586
  enum class ModuleDeclKind {
2587
    Interface,      ///< 'export module X;'
2588
    Implementation, ///< 'module X;'
2589
  };
2590
2591
  /// The parser has processed a module-declaration that begins the definition
2592
  /// of a module interface or implementation.
2593
  DeclGroupPtrTy ActOnModuleDecl(SourceLocation StartLoc,
2594
                                 SourceLocation ModuleLoc, ModuleDeclKind MDK,
2595
                                 ModuleIdPath Path, bool IsFirstDecl);
2596
2597
  /// The parser has processed a global-module-fragment declaration that begins
2598
  /// the definition of the global module fragment of the current module unit.
2599
  /// \param ModuleLoc The location of the 'module' keyword.
2600
  DeclGroupPtrTy ActOnGlobalModuleFragmentDecl(SourceLocation ModuleLoc);
2601
2602
  /// The parser has processed a private-module-fragment declaration that begins
2603
  /// the definition of the private module fragment of the current module unit.
2604
  /// \param ModuleLoc The location of the 'module' keyword.
2605
  /// \param PrivateLoc The location of the 'private' keyword.
2606
  DeclGroupPtrTy ActOnPrivateModuleFragmentDecl(SourceLocation ModuleLoc,
2607
                                                SourceLocation PrivateLoc);
2608
2609
  /// The parser has processed a module import declaration.
2610
  ///
2611
  /// \param StartLoc The location of the first token in the declaration. This
2612
  ///        could be the location of an '@', 'export', or 'import'.
2613
  /// \param ExportLoc The location of the 'export' keyword, if any.
2614
  /// \param ImportLoc The location of the 'import' keyword.
2615
  /// \param Path The module access path.
2616
  DeclResult ActOnModuleImport(SourceLocation StartLoc,
2617
                               SourceLocation ExportLoc,
2618
                               SourceLocation ImportLoc, ModuleIdPath Path);
2619
  DeclResult ActOnModuleImport(SourceLocation StartLoc,
2620
                               SourceLocation ExportLoc,
2621
                               SourceLocation ImportLoc, Module *M,
2622
                               ModuleIdPath Path = {});
2623
2624
  /// The parser has processed a module import translated from a
2625
  /// #include or similar preprocessing directive.
2626
  void ActOnModuleInclude(SourceLocation DirectiveLoc, Module *Mod);
2627
  void BuildModuleInclude(SourceLocation DirectiveLoc, Module *Mod);
2628
2629
  /// The parsed has entered a submodule.
2630
  void ActOnModuleBegin(SourceLocation DirectiveLoc, Module *Mod);
2631
  /// The parser has left a submodule.
2632
  void ActOnModuleEnd(SourceLocation DirectiveLoc, Module *Mod);
2633
2634
  /// Create an implicit import of the given module at the given
2635
  /// source location, for error recovery, if possible.
2636
  ///
2637
  /// This routine is typically used when an entity found by name lookup
2638
  /// is actually hidden within a module that we know about but the user
2639
  /// has forgotten to import.
2640
  void createImplicitModuleImportForErrorRecovery(SourceLocation Loc,
2641
                                                  Module *Mod);
2642
2643
  /// Kinds of missing import. Note, the values of these enumerators correspond
2644
  /// to %select values in diagnostics.
2645
  enum class MissingImportKind {
2646
    Declaration,
2647
    Definition,
2648
    DefaultArgument,
2649
    ExplicitSpecialization,
2650
    PartialSpecialization
2651
  };
2652
2653
  /// Diagnose that the specified declaration needs to be visible but
2654
  /// isn't, and suggest a module import that would resolve the problem.
2655
  void diagnoseMissingImport(SourceLocation Loc, NamedDecl *Decl,
2656
                             MissingImportKind MIK, bool Recover = true);
2657
  void diagnoseMissingImport(SourceLocation Loc, NamedDecl *Decl,
2658
                             SourceLocation DeclLoc, ArrayRef<Module *> Modules,
2659
                             MissingImportKind MIK, bool Recover);
2660
2661
  Decl *ActOnStartExportDecl(Scope *S, SourceLocation ExportLoc,
2662
                             SourceLocation LBraceLoc);
2663
  Decl *ActOnFinishExportDecl(Scope *S, Decl *ExportDecl,
2664
                              SourceLocation RBraceLoc);
2665
2666
  /// We've found a use of a templated declaration that would trigger an
2667
  /// implicit instantiation. Check that any relevant explicit specializations
2668
  /// and partial specializations are visible, and diagnose if not.
2669
  void checkSpecializationVisibility(SourceLocation Loc, NamedDecl *Spec);
2670
2671
  /// We've found a use of a template specialization that would select a
2672
  /// partial specialization. Check that the partial specialization is visible,
2673
  /// and diagnose if not.
2674
  void checkPartialSpecializationVisibility(SourceLocation Loc,
2675
                                            NamedDecl *Spec);
2676
2677
  /// Retrieve a suitable printing policy for diagnostics.
2678
72.5M
  PrintingPolicy getPrintingPolicy() const {
2679
72.5M
    return getPrintingPolicy(Context, PP);
2680
72.5M
  }
2681
2682
  /// Retrieve a suitable printing policy for diagnostics.
2683
  static PrintingPolicy getPrintingPolicy(const ASTContext &Ctx,
2684
                                          const Preprocessor &PP);
2685
2686
  /// Scope actions.
2687
  void ActOnPopScope(SourceLocation Loc, Scope *S);
2688
  void ActOnTranslationUnitScope(Scope *S);
2689
2690
  Decl *ParsedFreeStandingDeclSpec(Scope *S, AccessSpecifier AS, DeclSpec &DS,
2691
                                   RecordDecl *&AnonRecord);
2692
  Decl *ParsedFreeStandingDeclSpec(Scope *S, AccessSpecifier AS, DeclSpec &DS,
2693
                                   MultiTemplateParamsArg TemplateParams,
2694
                                   bool IsExplicitInstantiation,
2695
                                   RecordDecl *&AnonRecord);
2696
2697
  Decl *BuildAnonymousStructOrUnion(Scope *S, DeclSpec &DS,
2698
                                    AccessSpecifier AS,
2699
                                    RecordDecl *Record,
2700
                                    const PrintingPolicy &Policy);
2701
2702
  Decl *BuildMicrosoftCAnonymousStruct(Scope *S, DeclSpec &DS,
2703
                                       RecordDecl *Record);
2704
2705
  /// Common ways to introduce type names without a tag for use in diagnostics.
2706
  /// Keep in sync with err_tag_reference_non_tag.
2707
  enum NonTagKind {
2708
    NTK_NonStruct,
2709
    NTK_NonClass,
2710
    NTK_NonUnion,
2711
    NTK_NonEnum,
2712
    NTK_Typedef,
2713
    NTK_TypeAlias,
2714
    NTK_Template,
2715
    NTK_TypeAliasTemplate,
2716
    NTK_TemplateTemplateArgument,
2717
  };
2718
2719
  /// Given a non-tag type declaration, returns an enum useful for indicating
2720
  /// what kind of non-tag type this is.
2721
  NonTagKind getNonTagTypeDeclKind(const Decl *D, TagTypeKind TTK);
2722
2723
  bool isAcceptableTagRedeclaration(const TagDecl *Previous,
2724
                                    TagTypeKind NewTag, bool isDefinition,
2725
                                    SourceLocation NewTagLoc,
2726
                                    const IdentifierInfo *Name);
2727
2728
  enum TagUseKind {
2729
    TUK_Reference,   // Reference to a tag:  'struct foo *X;'
2730
    TUK_Declaration, // Fwd decl of a tag:   'struct foo;'
2731
    TUK_Definition,  // Definition of a tag: 'struct foo { int X; } Y;'
2732
    TUK_Friend       // Friend declaration:  'friend struct foo;'
2733
  };
2734
2735
  Decl *ActOnTag(Scope *S, unsigned TagSpec, TagUseKind TUK,
2736
                 SourceLocation KWLoc, CXXScopeSpec &SS, IdentifierInfo *Name,
2737
                 SourceLocation NameLoc, const ParsedAttributesView &Attr,
2738
                 AccessSpecifier AS, SourceLocation ModulePrivateLoc,
2739
                 MultiTemplateParamsArg TemplateParameterLists, bool &OwnedDecl,
2740
                 bool &IsDependent, SourceLocation ScopedEnumKWLoc,
2741
                 bool ScopedEnumUsesClassTag, TypeResult UnderlyingType,
2742
                 bool IsTypeSpecifier, bool IsTemplateParamOrArg,
2743
                 SkipBodyInfo *SkipBody = nullptr);
2744
2745
  Decl *ActOnTemplatedFriendTag(Scope *S, SourceLocation FriendLoc,
2746
                                unsigned TagSpec, SourceLocation TagLoc,
2747
                                CXXScopeSpec &SS, IdentifierInfo *Name,
2748
                                SourceLocation NameLoc,
2749
                                const ParsedAttributesView &Attr,
2750
                                MultiTemplateParamsArg TempParamLists);
2751
2752
  TypeResult ActOnDependentTag(Scope *S,
2753
                               unsigned TagSpec,
2754
                               TagUseKind TUK,
2755
                               const CXXScopeSpec &SS,
2756
                               IdentifierInfo *Name,
2757
                               SourceLocation TagLoc,
2758
                               SourceLocation NameLoc);
2759
2760
  void ActOnDefs(Scope *S, Decl *TagD, SourceLocation DeclStart,
2761
                 IdentifierInfo *ClassName,
2762
                 SmallVectorImpl<Decl *> &Decls);
2763
  Decl *ActOnField(Scope *S, Decl *TagD, SourceLocation DeclStart,
2764
                   Declarator &D, Expr *BitfieldWidth);
2765
2766
  FieldDecl *HandleField(Scope *S, RecordDecl *TagD, SourceLocation DeclStart,
2767
                         Declarator &D, Expr *BitfieldWidth,
2768
                         InClassInitStyle InitStyle,
2769
                         AccessSpecifier AS);
2770
  MSPropertyDecl *HandleMSProperty(Scope *S, RecordDecl *TagD,
2771
                                   SourceLocation DeclStart, Declarator &D,
2772
                                   Expr *BitfieldWidth,
2773
                                   InClassInitStyle InitStyle,
2774
                                   AccessSpecifier AS,
2775
                                   const ParsedAttr &MSPropertyAttr);
2776
2777
  FieldDecl *CheckFieldDecl(DeclarationName Name, QualType T,
2778
                            TypeSourceInfo *TInfo,
2779
                            RecordDecl *Record, SourceLocation Loc,
2780
                            bool Mutable, Expr *BitfieldWidth,
2781
                            InClassInitStyle InitStyle,
2782
                            SourceLocation TSSL,
2783
                            AccessSpecifier AS, NamedDecl *PrevDecl,
2784
                            Declarator *D = nullptr);
2785
2786
  bool CheckNontrivialField(FieldDecl *FD);
2787
  void DiagnoseNontrivial(const CXXRecordDecl *Record, CXXSpecialMember CSM);
2788
2789
  enum TrivialABIHandling {
2790
    /// The triviality of a method unaffected by "trivial_abi".
2791
    TAH_IgnoreTrivialABI,
2792
2793
    /// The triviality of a method affected by "trivial_abi".
2794
    TAH_ConsiderTrivialABI
2795
  };
2796
2797
  bool SpecialMemberIsTrivial(CXXMethodDecl *MD, CXXSpecialMember CSM,
2798
                              TrivialABIHandling TAH = TAH_IgnoreTrivialABI,
2799
                              bool Diagnose = false);
2800
2801
  /// For a defaulted function, the kind of defaulted function that it is.
2802
  class DefaultedFunctionKind {
2803
    CXXSpecialMember SpecialMember : 8;
2804
    DefaultedComparisonKind Comparison : 8;
2805
2806
  public:
2807
    DefaultedFunctionKind()
2808
775k
        : SpecialMember(CXXInvalid), Comparison(DefaultedComparisonKind::None) {
2809
775k
    }
2810
    DefaultedFunctionKind(CXXSpecialMember CSM)
2811
552k
        : SpecialMember(CSM), Comparison(DefaultedComparisonKind::None) {}
2812
    DefaultedFunctionKind(DefaultedComparisonKind Comp)
2813
5.20k
        : SpecialMember(CXXInvalid), Comparison(Comp) {}
2814
2815
279k
    bool isSpecialMember() const { return SpecialMember != CXXInvalid; }
2816
98.2k
    bool isComparison() const {
2817
98.2k
      return Comparison != DefaultedComparisonKind::None;
2818
98.2k
    }
2819
2820
71.1k
    explicit operator bool() const {
2821
71.1k
      return isSpecialMember() || 
isComparison()1.10k
;
2822
71.1k
    }
2823
2824
1.21M
    CXXSpecialMember asSpecialMember() const { return SpecialMember; }
2825
118k
    DefaultedComparisonKind asComparison() const { return Comparison; }
2826
2827
    /// Get the index of this function kind for use in diagnostics.
2828
0
    unsigned getDiagnosticIndex() const {
2829
0
      static_assert(CXXInvalid > CXXDestructor,
2830
0
                    "invalid should have highest index");
2831
0
      static_assert((unsigned)DefaultedComparisonKind::None == 0,
2832
0
                    "none should be equal to zero");
2833
0
      return SpecialMember + (unsigned)Comparison;
2834
0
    }
2835
  };
2836
2837
  DefaultedFunctionKind getDefaultedFunctionKind(const FunctionDecl *FD);
2838
2839
1.00M
  CXXSpecialMember getSpecialMember(const CXXMethodDecl *MD) {
2840
1.00M
    return getDefaultedFunctionKind(MD).asSpecialMember();
2841
1.00M
  }
2842
47.6k
  DefaultedComparisonKind getDefaultedComparisonKind(const FunctionDecl *FD) {
2843
47.6k
    return getDefaultedFunctionKind(FD).asComparison();
2844
47.6k
  }
2845
2846
  void ActOnLastBitfield(SourceLocation DeclStart,
2847
                         SmallVectorImpl<Decl *> &AllIvarDecls);
2848
  Decl *ActOnIvar(Scope *S, SourceLocation DeclStart,
2849
                  Declarator &D, Expr *BitfieldWidth,
2850
                  tok::ObjCKeywordKind visibility);
2851
2852
  // This is used for both record definitions and ObjC interface declarations.
2853
  void ActOnFields(Scope *S, SourceLocation RecLoc, Decl *TagDecl,
2854
                   ArrayRef<Decl *> Fields, SourceLocation LBrac,
2855
                   SourceLocation RBrac, const ParsedAttributesView &AttrList);
2856
2857
  /// ActOnTagStartDefinition - Invoked when we have entered the
2858
  /// scope of a tag's definition (e.g., for an enumeration, class,
2859
  /// struct, or union).
2860
  void ActOnTagStartDefinition(Scope *S, Decl *TagDecl);
2861
2862
  /// Perform ODR-like check for C/ObjC when merging tag types from modules.
2863
  /// Differently from C++, actually parse the body and reject / error out
2864
  /// in case of a structural mismatch.
2865
  bool ActOnDuplicateDefinition(DeclSpec &DS, Decl *Prev,
2866
                                SkipBodyInfo &SkipBody);
2867
2868
  typedef void *SkippedDefinitionContext;
2869
2870
  /// Invoked when we enter a tag definition that we're skipping.
2871
  SkippedDefinitionContext ActOnTagStartSkippedDefinition(Scope *S, Decl *TD);
2872
2873
  Decl *ActOnObjCContainerStartDefinition(Decl *IDecl);
2874
2875
  /// ActOnStartCXXMemberDeclarations - Invoked when we have parsed a
2876
  /// C++ record definition's base-specifiers clause and are starting its
2877
  /// member declarations.
2878
  void ActOnStartCXXMemberDeclarations(Scope *S, Decl *TagDecl,
2879
                                       SourceLocation FinalLoc,
2880
                                       bool IsFinalSpelledSealed,
2881
                                       SourceLocation LBraceLoc);
2882
2883
  /// ActOnTagFinishDefinition - Invoked once we have finished parsing
2884
  /// the definition of a tag (enumeration, class, struct, or union).
2885
  void ActOnTagFinishDefinition(Scope *S, Decl *TagDecl,
2886
                                SourceRange BraceRange);
2887
2888
  void ActOnTagFinishSkippedDefinition(SkippedDefinitionContext Context);
2889
2890
  void ActOnObjCContainerFinishDefinition();
2891
2892
  /// Invoked when we must temporarily exit the objective-c container
2893
  /// scope for parsing/looking-up C constructs.
2894
  ///
2895
  /// Must be followed by a call to \see ActOnObjCReenterContainerContext
2896
  void ActOnObjCTemporaryExitContainerContext(DeclContext *DC);
2897
  void ActOnObjCReenterContainerContext(DeclContext *DC);
2898
2899
  /// ActOnTagDefinitionError - Invoked when there was an unrecoverable
2900
  /// error parsing the definition of a tag.
2901
  void ActOnTagDefinitionError(Scope *S, Decl *TagDecl);
2902
2903
  EnumConstantDecl *CheckEnumConstant(EnumDecl *Enum,
2904
                                      EnumConstantDecl *LastEnumConst,
2905
                                      SourceLocation IdLoc,