Coverage Report

Created: 2019-07-24 05:18

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