Coverage Report

Created: 2018-11-16 02:38

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