Coverage Report

Created: 2020-02-18 08:44

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