Coverage Report

Created: 2019-02-23 12:57

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