Clang Project

clang_source_code/include/clang/AST/ExprCXX.h
1//===- ExprCXX.h - Classes for representing expressions ---------*- 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/// \file
10/// Defines the clang::Expr interface and subclasses for C++ expressions.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_CLANG_AST_EXPRCXX_H
15#define LLVM_CLANG_AST_EXPRCXX_H
16
17#include "clang/AST/Decl.h"
18#include "clang/AST/DeclBase.h"
19#include "clang/AST/DeclCXX.h"
20#include "clang/AST/DeclarationName.h"
21#include "clang/AST/Expr.h"
22#include "clang/AST/NestedNameSpecifier.h"
23#include "clang/AST/OperationKinds.h"
24#include "clang/AST/Stmt.h"
25#include "clang/AST/TemplateBase.h"
26#include "clang/AST/Type.h"
27#include "clang/AST/UnresolvedSet.h"
28#include "clang/Basic/ExceptionSpecificationType.h"
29#include "clang/Basic/ExpressionTraits.h"
30#include "clang/Basic/LLVM.h"
31#include "clang/Basic/Lambda.h"
32#include "clang/Basic/LangOptions.h"
33#include "clang/Basic/OperatorKinds.h"
34#include "clang/Basic/SourceLocation.h"
35#include "clang/Basic/Specifiers.h"
36#include "clang/Basic/TypeTraits.h"
37#include "llvm/ADT/ArrayRef.h"
38#include "llvm/ADT/None.h"
39#include "llvm/ADT/Optional.h"
40#include "llvm/ADT/PointerUnion.h"
41#include "llvm/ADT/StringRef.h"
42#include "llvm/ADT/iterator_range.h"
43#include "llvm/Support/Casting.h"
44#include "llvm/Support/Compiler.h"
45#include "llvm/Support/TrailingObjects.h"
46#include <cassert>
47#include <cstddef>
48#include <cstdint>
49#include <memory>
50
51namespace clang {
52
53class ASTContext;
54class DeclAccessPair;
55class IdentifierInfo;
56class LambdaCapture;
57class NonTypeTemplateParmDecl;
58class TemplateParameterList;
59
60//===--------------------------------------------------------------------===//
61// C++ Expressions.
62//===--------------------------------------------------------------------===//
63
64/// A call to an overloaded operator written using operator
65/// syntax.
66///
67/// Represents a call to an overloaded operator written using operator
68/// syntax, e.g., "x + y" or "*p". While semantically equivalent to a
69/// normal call, this AST node provides better information about the
70/// syntactic representation of the call.
71///
72/// In a C++ template, this expression node kind will be used whenever
73/// any of the arguments are type-dependent. In this case, the
74/// function itself will be a (possibly empty) set of functions and
75/// function templates that were found by name lookup at template
76/// definition time.
77class CXXOperatorCallExpr final : public CallExpr {
78  friend class ASTStmtReader;
79  friend class ASTStmtWriter;
80
81  SourceRange Range;
82
83  // CXXOperatorCallExpr has some trailing objects belonging
84  // to CallExpr. See CallExpr for the details.
85
86  SourceRange getSourceRangeImpl() const LLVM_READONLY;
87
88  CXXOperatorCallExpr(OverloadedOperatorKind OpKindExpr *Fn,
89                      ArrayRef<Expr *> ArgsQualType TyExprValueKind VK,
90                      SourceLocation OperatorLocFPOptions FPFeatures,
91                      ADLCallKind UsesADL);
92
93  CXXOperatorCallExpr(unsigned NumArgsEmptyShell Empty);
94
95public:
96  static CXXOperatorCallExpr *
97  Create(const ASTContext &CtxOverloadedOperatorKind OpKindExpr *Fn,
98         ArrayRef<Expr *> ArgsQualType TyExprValueKind VK,
99         SourceLocation OperatorLocFPOptions FPFeatures,
100         ADLCallKind UsesADL = NotADL);
101
102  static CXXOperatorCallExpr *CreateEmpty(const ASTContext &Ctx,
103                                          unsigned NumArgsEmptyShell Empty);
104
105  /// Returns the kind of overloaded operator that this expression refers to.
106  OverloadedOperatorKind getOperator() const {
107    return static_cast<OverloadedOperatorKind>(
108        CXXOperatorCallExprBits.OperatorKind);
109  }
110
111  static bool isAssignmentOp(OverloadedOperatorKind Opc) {
112    return Opc == OO_Equal || Opc == OO_StarEqual || Opc == OO_SlashEqual ||
113           Opc == OO_PercentEqual || Opc == OO_PlusEqual ||
114           Opc == OO_MinusEqual || Opc == OO_LessLessEqual ||
115           Opc == OO_GreaterGreaterEqual || Opc == OO_AmpEqual ||
116           Opc == OO_CaretEqual || Opc == OO_PipeEqual;
117  }
118  bool isAssignmentOp() const { return isAssignmentOp(getOperator()); }
119
120  /// Is this written as an infix binary operator?
121  bool isInfixBinaryOp() const;
122
123  /// Returns the location of the operator symbol in the expression.
124  ///
125  /// When \c getOperator()==OO_Call, this is the location of the right
126  /// parentheses; when \c getOperator()==OO_Subscript, this is the location
127  /// of the right bracket.
128  SourceLocation getOperatorLoc() const { return getRParenLoc(); }
129
130  SourceLocation getExprLoc() const LLVM_READONLY {
131    OverloadedOperatorKind Operator = getOperator();
132    return (Operator < OO_Plus || Operator >= OO_Arrow ||
133            Operator == OO_PlusPlus || Operator == OO_MinusMinus)
134               ? getBeginLoc()
135               : getOperatorLoc();
136  }
137
138  SourceLocation getBeginLoc() const { return Range.getBegin(); }
139  SourceLocation getEndLoc() const { return Range.getEnd(); }
140  SourceRange getSourceRange() const { return Range; }
141
142  static bool classof(const Stmt *T) {
143    return T->getStmtClass() == CXXOperatorCallExprClass;
144  }
145
146  // Set the FP contractability status of this operator. Only meaningful for
147  // operations on floating point types.
148  void setFPFeatures(FPOptions F) {
149    CXXOperatorCallExprBits.FPFeatures = F.getInt();
150  }
151  FPOptions getFPFeatures() const {
152    return FPOptions(CXXOperatorCallExprBits.FPFeatures);
153  }
154
155  // Get the FP contractability status of this operator. Only meaningful for
156  // operations on floating point types.
157  bool isFPContractableWithinStatement() const {
158    return getFPFeatures().allowFPContractWithinStatement();
159  }
160};
161
162/// Represents a call to a member function that
163/// may be written either with member call syntax (e.g., "obj.func()"
164/// or "objptr->func()") or with normal function-call syntax
165/// ("func()") within a member function that ends up calling a member
166/// function. The callee in either case is a MemberExpr that contains
167/// both the object argument and the member function, while the
168/// arguments are the arguments within the parentheses (not including
169/// the object argument).
170class CXXMemberCallExpr final : public CallExpr {
171  // CXXMemberCallExpr has some trailing objects belonging
172  // to CallExpr. See CallExpr for the details.
173
174  CXXMemberCallExpr(Expr *FnArrayRef<Expr *> ArgsQualType Ty,
175                    ExprValueKind VKSourceLocation RPunsigned MinNumArgs);
176
177  CXXMemberCallExpr(unsigned NumArgsEmptyShell Empty);
178
179public:
180  static CXXMemberCallExpr *Create(const ASTContext &CtxExpr *Fn,
181                                   ArrayRef<Expr *> ArgsQualType Ty,
182                                   ExprValueKind VKSourceLocation RP,
183                                   unsigned MinNumArgs = 0);
184
185  static CXXMemberCallExpr *CreateEmpty(const ASTContext &Ctxunsigned NumArgs,
186                                        EmptyShell Empty);
187
188  /// Retrieves the implicit object argument for the member call.
189  ///
190  /// For example, in "x.f(5)", this returns the sub-expression "x".
191  Expr *getImplicitObjectArgument() const;
192
193  /// Retrieves the declaration of the called method.
194  CXXMethodDecl *getMethodDecl() const;
195
196  /// Retrieves the CXXRecordDecl for the underlying type of
197  /// the implicit object argument.
198  ///
199  /// Note that this is may not be the same declaration as that of the class
200  /// context of the CXXMethodDecl which this function is calling.
201  /// FIXME: Returns 0 for member pointer call exprs.
202  CXXRecordDecl *getRecordDecl() const;
203
204  SourceLocation getExprLoc() const LLVM_READONLY {
205    SourceLocation CLoc = getCallee()->getExprLoc();
206    if (CLoc.isValid())
207      return CLoc;
208
209    return getBeginLoc();
210  }
211
212  static bool classof(const Stmt *T) {
213    return T->getStmtClass() == CXXMemberCallExprClass;
214  }
215};
216
217/// Represents a call to a CUDA kernel function.
218class CUDAKernelCallExpr final : public CallExpr {
219  enum { CONFIGEND_PREARG };
220
221  // CUDAKernelCallExpr has some trailing objects belonging
222  // to CallExpr. See CallExpr for the details.
223
224  CUDAKernelCallExpr(Expr *FnCallExpr *ConfigArrayRef<Expr *> Args,
225                     QualType TyExprValueKind VKSourceLocation RP,
226                     unsigned MinNumArgs);
227
228  CUDAKernelCallExpr(unsigned NumArgsEmptyShell Empty);
229
230public:
231  static CUDAKernelCallExpr *Create(const ASTContext &CtxExpr *Fn,
232                                    CallExpr *ConfigArrayRef<Expr *> Args,
233                                    QualType TyExprValueKind VK,
234                                    SourceLocation RPunsigned MinNumArgs = 0);
235
236  static CUDAKernelCallExpr *CreateEmpty(const ASTContext &Ctx,
237                                         unsigned NumArgsEmptyShell Empty);
238
239  const CallExpr *getConfig() const {
240    return cast_or_null<CallExpr>(getPreArg(CONFIG));
241  }
242  CallExpr *getConfig() { return cast_or_null<CallExpr>(getPreArg(CONFIG)); }
243
244  /// Sets the kernel configuration expression.
245  ///
246  /// Note that this method cannot be called if config has already been set to a
247  /// non-null value.
248  void setConfig(CallExpr *E) {
249     (0) . __assert_fail ("!getConfig() && \"Cannot call setConfig if config is not null\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/ExprCXX.h", 250, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(!getConfig() &&
250 (0) . __assert_fail ("!getConfig() && \"Cannot call setConfig if config is not null\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/ExprCXX.h", 250, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "Cannot call setConfig if config is not null");
251    setPreArg(CONFIGE);
252    setInstantiationDependent(isInstantiationDependent() ||
253                              E->isInstantiationDependent());
254    setContainsUnexpandedParameterPack(containsUnexpandedParameterPack() ||
255                                       E->containsUnexpandedParameterPack());
256  }
257
258  static bool classof(const Stmt *T) {
259    return T->getStmtClass() == CUDAKernelCallExprClass;
260  }
261};
262
263/// Abstract class common to all of the C++ "named"/"keyword" casts.
264///
265/// This abstract class is inherited by all of the classes
266/// representing "named" casts: CXXStaticCastExpr for \c static_cast,
267/// CXXDynamicCastExpr for \c dynamic_cast, CXXReinterpretCastExpr for
268/// reinterpret_cast, and CXXConstCastExpr for \c const_cast.
269class CXXNamedCastExpr : public ExplicitCastExpr {
270private:
271  // the location of the casting op
272  SourceLocation Loc;
273
274  // the location of the right parenthesis
275  SourceLocation RParenLoc;
276
277  // range for '<' '>'
278  SourceRange AngleBrackets;
279
280protected:
281  friend class ASTStmtReader;
282
283  CXXNamedCastExpr(StmtClass SCQualType tyExprValueKind VK,
284                   CastKind kindExpr *opunsigned PathSize,
285                   TypeSourceInfo *writtenTySourceLocation l,
286                   SourceLocation RParenLoc,
287                   SourceRange AngleBrackets)
288      : ExplicitCastExpr(SCtyVKkindopPathSizewrittenTy), Loc(l),
289        RParenLoc(RParenLoc), AngleBrackets(AngleBrackets) {}
290
291  explicit CXXNamedCastExpr(StmtClass SCEmptyShell Shellunsigned PathSize)
292      : ExplicitCastExpr(SCShellPathSize) {}
293
294public:
295  const char *getCastName() const;
296
297  /// Retrieve the location of the cast operator keyword, e.g.,
298  /// \c static_cast.
299  SourceLocation getOperatorLoc() const { return Loc; }
300
301  /// Retrieve the location of the closing parenthesis.
302  SourceLocation getRParenLoc() const { return RParenLoc; }
303
304  SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; }
305  SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; }
306  SourceRange getAngleBrackets() const LLVM_READONLY { return AngleBrackets; }
307
308  static bool classof(const Stmt *T) {
309    switch (T->getStmtClass()) {
310    case CXXStaticCastExprClass:
311    case CXXDynamicCastExprClass:
312    case CXXReinterpretCastExprClass:
313    case CXXConstCastExprClass:
314      return true;
315    default:
316      return false;
317    }
318  }
319};
320
321/// A C++ \c static_cast expression (C++ [expr.static.cast]).
322///
323/// This expression node represents a C++ static cast, e.g.,
324/// \c static_cast<int>(1.0).
325class CXXStaticCastExpr final
326    : public CXXNamedCastExpr,
327      private llvm::TrailingObjects<CXXStaticCastExpr, CXXBaseSpecifier *> {
328  CXXStaticCastExpr(QualType tyExprValueKind vkCastKind kindExpr *op,
329                    unsigned pathSizeTypeSourceInfo *writtenTy,
330                    SourceLocation lSourceLocation RParenLoc,
331                    SourceRange AngleBrackets)
332      : CXXNamedCastExpr(CXXStaticCastExprClass, ty, vk, kind, op, pathSize,
333                         writtenTy, l, RParenLoc, AngleBrackets) {}
334
335  explicit CXXStaticCastExpr(EmptyShell Emptyunsigned PathSize)
336      : CXXNamedCastExpr(CXXStaticCastExprClass, Empty, PathSize) {}
337
338public:
339  friend class CastExpr;
340  friend TrailingObjects;
341
342  static CXXStaticCastExpr *Create(const ASTContext &ContextQualType T,
343                                   ExprValueKind VKCastKind KExpr *Op,
344                                   const CXXCastPath *Path,
345                                   TypeSourceInfo *WrittenSourceLocation L,
346                                   SourceLocation RParenLoc,
347                                   SourceRange AngleBrackets);
348  static CXXStaticCastExpr *CreateEmpty(const ASTContext &Context,
349                                        unsigned PathSize);
350
351  static bool classof(const Stmt *T) {
352    return T->getStmtClass() == CXXStaticCastExprClass;
353  }
354};
355
356/// A C++ @c dynamic_cast expression (C++ [expr.dynamic.cast]).
357///
358/// This expression node represents a dynamic cast, e.g.,
359/// \c dynamic_cast<Derived*>(BasePtr). Such a cast may perform a run-time
360/// check to determine how to perform the type conversion.
361class CXXDynamicCastExpr final
362    : public CXXNamedCastExpr,
363      private llvm::TrailingObjects<CXXDynamicCastExpr, CXXBaseSpecifier *> {
364  CXXDynamicCastExpr(QualType tyExprValueKind VKCastKind kind,
365                     Expr *opunsigned pathSizeTypeSourceInfo *writtenTy,
366                     SourceLocation lSourceLocation RParenLoc,
367                     SourceRange AngleBrackets)
368      : CXXNamedCastExpr(CXXDynamicCastExprClass, ty, VK, kind, op, pathSize,
369                         writtenTy, l, RParenLoc, AngleBrackets) {}
370
371  explicit CXXDynamicCastExpr(EmptyShell Emptyunsigned pathSize)
372      : CXXNamedCastExpr(CXXDynamicCastExprClass, Empty, pathSize) {}
373
374public:
375  friend class CastExpr;
376  friend TrailingObjects;
377
378  static CXXDynamicCastExpr *Create(const ASTContext &ContextQualType T,
379                                    ExprValueKind VKCastKind KindExpr *Op,
380                                    const CXXCastPath *Path,
381                                    TypeSourceInfo *WrittenSourceLocation L,
382                                    SourceLocation RParenLoc,
383                                    SourceRange AngleBrackets);
384
385  static CXXDynamicCastExpr *CreateEmpty(const ASTContext &Context,
386                                         unsigned pathSize);
387
388  bool isAlwaysNull() const;
389
390  static bool classof(const Stmt *T) {
391    return T->getStmtClass() == CXXDynamicCastExprClass;
392  }
393};
394
395/// A C++ @c reinterpret_cast expression (C++ [expr.reinterpret.cast]).
396///
397/// This expression node represents a reinterpret cast, e.g.,
398/// @c reinterpret_cast<int>(VoidPtr).
399///
400/// A reinterpret_cast provides a differently-typed view of a value but
401/// (in Clang, as in most C++ implementations) performs no actual work at
402/// run time.
403class CXXReinterpretCastExpr final
404    : public CXXNamedCastExpr,
405      private llvm::TrailingObjects<CXXReinterpretCastExpr,
406                                    CXXBaseSpecifier *> {
407  CXXReinterpretCastExpr(QualType tyExprValueKind vkCastKind kind,
408                         Expr *opunsigned pathSize,
409                         TypeSourceInfo *writtenTySourceLocation l,
410                         SourceLocation RParenLoc,
411                         SourceRange AngleBrackets)
412      : CXXNamedCastExpr(CXXReinterpretCastExprClass, ty, vk, kind, op,
413                         pathSize, writtenTy, l, RParenLoc, AngleBrackets) {}
414
415  CXXReinterpretCastExpr(EmptyShell Emptyunsigned pathSize)
416      : CXXNamedCastExpr(CXXReinterpretCastExprClass, Empty, pathSize) {}
417
418public:
419  friend class CastExpr;
420  friend TrailingObjects;
421
422  static CXXReinterpretCastExpr *Create(const ASTContext &ContextQualType T,
423                                        ExprValueKind VKCastKind Kind,
424                                        Expr *Opconst CXXCastPath *Path,
425                                 TypeSourceInfo *WrittenTySourceLocation L,
426                                        SourceLocation RParenLoc,
427                                        SourceRange AngleBrackets);
428  static CXXReinterpretCastExpr *CreateEmpty(const ASTContext &Context,
429                                             unsigned pathSize);
430
431  static bool classof(const Stmt *T) {
432    return T->getStmtClass() == CXXReinterpretCastExprClass;
433  }
434};
435
436/// A C++ \c const_cast expression (C++ [expr.const.cast]).
437///
438/// This expression node represents a const cast, e.g.,
439/// \c const_cast<char*>(PtrToConstChar).
440///
441/// A const_cast can remove type qualifiers but does not change the underlying
442/// value.
443class CXXConstCastExpr final
444    : public CXXNamedCastExpr,
445      private llvm::TrailingObjects<CXXConstCastExpr, CXXBaseSpecifier *> {
446  CXXConstCastExpr(QualType tyExprValueKind VKExpr *op,
447                   TypeSourceInfo *writtenTySourceLocation l,
448                   SourceLocation RParenLocSourceRange AngleBrackets)
449      : CXXNamedCastExpr(CXXConstCastExprClass, ty, VK, CK_NoOp, op,
450                         0, writtenTy, l, RParenLoc, AngleBrackets) {}
451
452  explicit CXXConstCastExpr(EmptyShell Empty)
453      : CXXNamedCastExpr(CXXConstCastExprClass, Empty, 0) {}
454
455public:
456  friend class CastExpr;
457  friend TrailingObjects;
458
459  static CXXConstCastExpr *Create(const ASTContext &ContextQualType T,
460                                  ExprValueKind VKExpr *Op,
461                                  TypeSourceInfo *WrittenTySourceLocation L,
462                                  SourceLocation RParenLoc,
463                                  SourceRange AngleBrackets);
464  static CXXConstCastExpr *CreateEmpty(const ASTContext &Context);
465
466  static bool classof(const Stmt *T) {
467    return T->getStmtClass() == CXXConstCastExprClass;
468  }
469};
470
471/// A call to a literal operator (C++11 [over.literal])
472/// written as a user-defined literal (C++11 [lit.ext]).
473///
474/// Represents a user-defined literal, e.g. "foo"_bar or 1.23_xyz. While this
475/// is semantically equivalent to a normal call, this AST node provides better
476/// information about the syntactic representation of the literal.
477///
478/// Since literal operators are never found by ADL and can only be declared at
479/// namespace scope, a user-defined literal is never dependent.
480class UserDefinedLiteral final : public CallExpr {
481  friend class ASTStmtReader;
482  friend class ASTStmtWriter;
483
484  /// The location of a ud-suffix within the literal.
485  SourceLocation UDSuffixLoc;
486
487  // UserDefinedLiteral has some trailing objects belonging
488  // to CallExpr. See CallExpr for the details.
489
490  UserDefinedLiteral(Expr *FnArrayRef<Expr *> ArgsQualType Ty,
491                     ExprValueKind VKSourceLocation LitEndLoc,
492                     SourceLocation SuffixLoc);
493
494  UserDefinedLiteral(unsigned NumArgsEmptyShell Empty);
495
496public:
497  static UserDefinedLiteral *Create(const ASTContext &CtxExpr *Fn,
498                                    ArrayRef<Expr *> ArgsQualType Ty,
499                                    ExprValueKind VKSourceLocation LitEndLoc,
500                                    SourceLocation SuffixLoc);
501
502  static UserDefinedLiteral *CreateEmpty(const ASTContext &Ctx,
503                                         unsigned NumArgsEmptyShell Empty);
504
505  /// The kind of literal operator which is invoked.
506  enum LiteralOperatorKind {
507    /// Raw form: operator "" X (const char *)
508    LOK_Raw,
509
510    /// Raw form: operator "" X<cs...> ()
511    LOK_Template,
512
513    /// operator "" X (unsigned long long)
514    LOK_Integer,
515
516    /// operator "" X (long double)
517    LOK_Floating,
518
519    /// operator "" X (const CharT *, size_t)
520    LOK_String,
521
522    /// operator "" X (CharT)
523    LOK_Character
524  };
525
526  /// Returns the kind of literal operator invocation
527  /// which this expression represents.
528  LiteralOperatorKind getLiteralOperatorKind() const;
529
530  /// If this is not a raw user-defined literal, get the
531  /// underlying cooked literal (representing the literal with the suffix
532  /// removed).
533  Expr *getCookedLiteral();
534  const Expr *getCookedLiteral() const {
535    return const_cast<UserDefinedLiteral*>(this)->getCookedLiteral();
536  }
537
538  SourceLocation getBeginLoc() const {
539    if (getLiteralOperatorKind() == LOK_Template)
540      return getRParenLoc();
541    return getArg(0)->getBeginLoc();
542  }
543
544  SourceLocation getEndLoc() const { return getRParenLoc(); }
545
546  /// Returns the location of a ud-suffix in the expression.
547  ///
548  /// For a string literal, there may be multiple identical suffixes. This
549  /// returns the first.
550  SourceLocation getUDSuffixLoc() const { return UDSuffixLoc; }
551
552  /// Returns the ud-suffix specified for this literal.
553  const IdentifierInfo *getUDSuffix() const;
554
555  static bool classof(const Stmt *S) {
556    return S->getStmtClass() == UserDefinedLiteralClass;
557  }
558};
559
560/// A boolean literal, per ([C++ lex.bool] Boolean literals).
561class CXXBoolLiteralExpr : public Expr {
562public:
563  CXXBoolLiteralExpr(bool ValQualType TySourceLocation Loc)
564      : Expr(CXXBoolLiteralExprClass, Ty, VK_RValue, OK_Ordinary, falsefalse,
565             falsefalse) {
566    CXXBoolLiteralExprBits.Value = Val;
567    CXXBoolLiteralExprBits.Loc = Loc;
568  }
569
570  explicit CXXBoolLiteralExpr(EmptyShell Empty)
571      : Expr(CXXBoolLiteralExprClass, Empty) {}
572
573  bool getValue() const { return CXXBoolLiteralExprBits.Value; }
574  void setValue(bool V) { CXXBoolLiteralExprBits.Value = V; }
575
576  SourceLocation getBeginLoc() const { return getLocation(); }
577  SourceLocation getEndLoc() const { return getLocation(); }
578
579  SourceLocation getLocation() const { return CXXBoolLiteralExprBits.Loc; }
580  void setLocation(SourceLocation L) { CXXBoolLiteralExprBits.Loc = L; }
581
582  static bool classof(const Stmt *T) {
583    return T->getStmtClass() == CXXBoolLiteralExprClass;
584  }
585
586  // Iterators
587  child_range children() {
588    return child_range(child_iterator(), child_iterator());
589  }
590};
591
592/// The null pointer literal (C++11 [lex.nullptr])
593///
594/// Introduced in C++11, the only literal of type \c nullptr_t is \c nullptr.
595class CXXNullPtrLiteralExpr : public Expr {
596public:
597  CXXNullPtrLiteralExpr(QualType TySourceLocation Loc)
598      : Expr(CXXNullPtrLiteralExprClass, Ty, VK_RValue, OK_Ordinary, false,
599             falsefalsefalse) {
600    CXXNullPtrLiteralExprBits.Loc = Loc;
601  }
602
603  explicit CXXNullPtrLiteralExpr(EmptyShell Empty)
604      : Expr(CXXNullPtrLiteralExprClass, Empty) {}
605
606  SourceLocation getBeginLoc() const { return getLocation(); }
607  SourceLocation getEndLoc() const { return getLocation(); }
608
609  SourceLocation getLocation() const { return CXXNullPtrLiteralExprBits.Loc; }
610  void setLocation(SourceLocation L) { CXXNullPtrLiteralExprBits.Loc = L; }
611
612  static bool classof(const Stmt *T) {
613    return T->getStmtClass() == CXXNullPtrLiteralExprClass;
614  }
615
616  child_range children() {
617    return child_range(child_iterator(), child_iterator());
618  }
619};
620
621/// Implicit construction of a std::initializer_list<T> object from an
622/// array temporary within list-initialization (C++11 [dcl.init.list]p5).
623class CXXStdInitializerListExpr : public Expr {
624  Stmt *SubExpr = nullptr;
625
626  CXXStdInitializerListExpr(EmptyShell Empty)
627      : Expr(CXXStdInitializerListExprClass, Empty) {}
628
629public:
630  friend class ASTReader;
631  friend class ASTStmtReader;
632
633  CXXStdInitializerListExpr(QualType TyExpr *SubExpr)
634      : Expr(CXXStdInitializerListExprClass, Ty, VK_RValue, OK_Ordinary,
635             Ty->isDependentType(), SubExpr->isValueDependent(),
636             SubExpr->isInstantiationDependent(),
637             SubExpr->containsUnexpandedParameterPack()),
638        SubExpr(SubExpr) {}
639
640  Expr *getSubExpr() { return static_cast<Expr*>(SubExpr); }
641  const Expr *getSubExpr() const { return static_cast<const Expr*>(SubExpr); }
642
643  SourceLocation getBeginLoc() const LLVM_READONLY {
644    return SubExpr->getBeginLoc();
645  }
646
647  SourceLocation getEndLoc() const LLVM_READONLY {
648    return SubExpr->getEndLoc();
649  }
650
651  /// Retrieve the source range of the expression.
652  SourceRange getSourceRange() const LLVM_READONLY {
653    return SubExpr->getSourceRange();
654  }
655
656  static bool classof(const Stmt *S) {
657    return S->getStmtClass() == CXXStdInitializerListExprClass;
658  }
659
660  child_range children() { return child_range(&SubExpr, &SubExpr + 1); }
661};
662
663/// A C++ \c typeid expression (C++ [expr.typeid]), which gets
664/// the \c type_info that corresponds to the supplied type, or the (possibly
665/// dynamic) type of the supplied expression.
666///
667/// This represents code like \c typeid(int) or \c typeid(*objPtr)
668class CXXTypeidExpr : public Expr {
669private:
670  llvm::PointerUnion<Stmt *, TypeSourceInfo *> Operand;
671  SourceRange Range;
672
673public:
674  CXXTypeidExpr(QualType TyTypeSourceInfo *OperandSourceRange R)
675      : Expr(CXXTypeidExprClass, Ty, VK_LValue, OK_Ordinary,
676             // typeid is never type-dependent (C++ [temp.dep.expr]p4)
677             false,
678             // typeid is value-dependent if the type or expression are
679             // dependent
680             Operand->getType()->isDependentType(),
681             Operand->getType()->isInstantiationDependentType(),
682             Operand->getType()->containsUnexpandedParameterPack()),
683        Operand(Operand), Range(R) {}
684
685  CXXTypeidExpr(QualType TyExpr *OperandSourceRange R)
686      : Expr(CXXTypeidExprClass, Ty, VK_LValue, OK_Ordinary,
687             // typeid is never type-dependent (C++ [temp.dep.expr]p4)
688             false,
689             // typeid is value-dependent if the type or expression are
690             // dependent
691             Operand->isTypeDependent() || Operand->isValueDependent(),
692             Operand->isInstantiationDependent(),
693             Operand->containsUnexpandedParameterPack()),
694        Operand(Operand), Range(R) {}
695
696  CXXTypeidExpr(EmptyShell Emptybool isExpr)
697      : Expr(CXXTypeidExprClass, Empty) {
698    if (isExpr)
699      Operand = (Expr*)nullptr;
700    else
701      Operand = (TypeSourceInfo*)nullptr;
702  }
703
704  /// Determine whether this typeid has a type operand which is potentially
705  /// evaluated, per C++11 [expr.typeid]p3.
706  bool isPotentiallyEvaluated() const;
707
708  bool isTypeOperand() const { return Operand.is<TypeSourceInfo *>(); }
709
710  /// Retrieves the type operand of this typeid() expression after
711  /// various required adjustments (removing reference types, cv-qualifiers).
712  QualType getTypeOperand(ASTContext &Contextconst;
713
714  /// Retrieve source information for the type operand.
715  TypeSourceInfo *getTypeOperandSourceInfo() const {
716     (0) . __assert_fail ("isTypeOperand() && \"Cannot call getTypeOperand for typeid(expr)\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/ExprCXX.h", 716, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(isTypeOperand() && "Cannot call getTypeOperand for typeid(expr)");
717    return Operand.get<TypeSourceInfo *>();
718  }
719
720  void setTypeOperandSourceInfo(TypeSourceInfo *TSI) {
721     (0) . __assert_fail ("isTypeOperand() && \"Cannot call getTypeOperand for typeid(expr)\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/ExprCXX.h", 721, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(isTypeOperand() && "Cannot call getTypeOperand for typeid(expr)");
722    Operand = TSI;
723  }
724
725  Expr *getExprOperand() const {
726     (0) . __assert_fail ("!isTypeOperand() && \"Cannot call getExprOperand for typeid(type)\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/ExprCXX.h", 726, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(!isTypeOperand() && "Cannot call getExprOperand for typeid(type)");
727    return static_cast<Expr*>(Operand.get<Stmt *>());
728  }
729
730  void setExprOperand(Expr *E) {
731     (0) . __assert_fail ("!isTypeOperand() && \"Cannot call getExprOperand for typeid(type)\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/ExprCXX.h", 731, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(!isTypeOperand() && "Cannot call getExprOperand for typeid(type)");
732    Operand = E;
733  }
734
735  SourceLocation getBeginLoc() const LLVM_READONLY { return Range.getBegin(); }
736  SourceLocation getEndLoc() const LLVM_READONLY { return Range.getEnd(); }
737  SourceRange getSourceRange() const LLVM_READONLY { return Range; }
738  void setSourceRange(SourceRange R) { Range = R; }
739
740  static bool classof(const Stmt *T) {
741    return T->getStmtClass() == CXXTypeidExprClass;
742  }
743
744  // Iterators
745  child_range children() {
746    if (isTypeOperand())
747      return child_range(child_iterator(), child_iterator());
748    auto **begin = reinterpret_cast<Stmt **>(&Operand);
749    return child_range(begin, begin + 1);
750  }
751};
752
753/// A member reference to an MSPropertyDecl.
754///
755/// This expression always has pseudo-object type, and therefore it is
756/// typically not encountered in a fully-typechecked expression except
757/// within the syntactic form of a PseudoObjectExpr.
758class MSPropertyRefExpr : public Expr {
759  Expr *BaseExpr;
760  MSPropertyDecl *TheDecl;
761  SourceLocation MemberLoc;
762  bool IsArrow;
763  NestedNameSpecifierLoc QualifierLoc;
764
765public:
766  friend class ASTStmtReader;
767
768  MSPropertyRefExpr(Expr *baseExprMSPropertyDecl *declbool isArrow,
769                    QualType tyExprValueKind VK,
770                    NestedNameSpecifierLoc qualifierLoc,
771                    SourceLocation nameLoc)
772      : Expr(MSPropertyRefExprClass, ty, VK, OK_Ordinary,
773             /*type-dependent*/ false, baseExpr->isValueDependent(),
774             baseExpr->isInstantiationDependent(),
775             baseExpr->containsUnexpandedParameterPack()),
776        BaseExpr(baseExpr), TheDecl(decl),
777        MemberLoc(nameLoc), IsArrow(isArrow),
778        QualifierLoc(qualifierLoc) {}
779
780  MSPropertyRefExpr(EmptyShell Empty) : Expr(MSPropertyRefExprClass, Empty) {}
781
782  SourceRange getSourceRange() const LLVM_READONLY {
783    return SourceRange(getBeginLoc(), getEndLoc());
784  }
785
786  bool isImplicitAccess() const {
787    return getBaseExpr() && getBaseExpr()->isImplicitCXXThis();
788  }
789
790  SourceLocation getBeginLoc() const {
791    if (!isImplicitAccess())
792      return BaseExpr->getBeginLoc();
793    else if (QualifierLoc)
794      return QualifierLoc.getBeginLoc();
795    else
796        return MemberLoc;
797  }
798
799  SourceLocation getEndLoc() const { return getMemberLoc(); }
800
801  child_range children() {
802    return child_range((Stmt**)&BaseExpr, (Stmt**)&BaseExpr + 1);
803  }
804
805  static bool classof(const Stmt *T) {
806    return T->getStmtClass() == MSPropertyRefExprClass;
807  }
808
809  Expr *getBaseExpr() const { return BaseExpr; }
810  MSPropertyDecl *getPropertyDecl() const { return TheDecl; }
811  bool isArrow() const { return IsArrow; }
812  SourceLocation getMemberLoc() const { return MemberLoc; }
813  NestedNameSpecifierLoc getQualifierLoc() const { return QualifierLoc; }
814};
815
816/// MS property subscript expression.
817/// MSVC supports 'property' attribute and allows to apply it to the
818/// declaration of an empty array in a class or structure definition.
819/// For example:
820/// \code
821/// __declspec(property(get=GetX, put=PutX)) int x[];
822/// \endcode
823/// The above statement indicates that x[] can be used with one or more array
824/// indices. In this case, i=p->x[a][b] will be turned into i=p->GetX(a, b), and
825/// p->x[a][b] = i will be turned into p->PutX(a, b, i).
826/// This is a syntactic pseudo-object expression.
827class MSPropertySubscriptExpr : public Expr {
828  friend class ASTStmtReader;
829
830  enum { BASE_EXPRIDX_EXPRNUM_SUBEXPRS = 2 };
831
832  Stmt *SubExprs[NUM_SUBEXPRS];
833  SourceLocation RBracketLoc;
834
835  void setBase(Expr *Base) { SubExprs[BASE_EXPR] = Base; }
836  void setIdx(Expr *Idx) { SubExprs[IDX_EXPR] = Idx; }
837
838public:
839  MSPropertySubscriptExpr(Expr *BaseExpr *IdxQualType TyExprValueKind VK,
840                          ExprObjectKind OKSourceLocation RBracketLoc)
841      : Expr(MSPropertySubscriptExprClass, Ty, VK, OK, Idx->isTypeDependent(),
842             Idx->isValueDependent(), Idx->isInstantiationDependent(),
843             Idx->containsUnexpandedParameterPack()),
844        RBracketLoc(RBracketLoc) {
845    SubExprs[BASE_EXPR] = Base;
846    SubExprs[IDX_EXPR] = Idx;
847  }
848
849  /// Create an empty array subscript expression.
850  explicit MSPropertySubscriptExpr(EmptyShell Shell)
851      : Expr(MSPropertySubscriptExprClass, Shell) {}
852
853  Expr *getBase() { return cast<Expr>(SubExprs[BASE_EXPR]); }
854  const Expr *getBase() const { return cast<Expr>(SubExprs[BASE_EXPR]); }
855
856  Expr *getIdx() { return cast<Expr>(SubExprs[IDX_EXPR]); }
857  const Expr *getIdx() const { return cast<Expr>(SubExprs[IDX_EXPR]); }
858
859  SourceLocation getBeginLoc() const LLVM_READONLY {
860    return getBase()->getBeginLoc();
861  }
862
863  SourceLocation getEndLoc() const LLVM_READONLY { return RBracketLoc; }
864
865  SourceLocation getRBracketLoc() const { return RBracketLoc; }
866  void setRBracketLoc(SourceLocation L) { RBracketLoc = L; }
867
868  SourceLocation getExprLoc() const LLVM_READONLY {
869    return getBase()->getExprLoc();
870  }
871
872  static bool classof(const Stmt *T) {
873    return T->getStmtClass() == MSPropertySubscriptExprClass;
874  }
875
876  // Iterators
877  child_range children() {
878    return child_range(&SubExprs[0], &SubExprs[0] + NUM_SUBEXPRS);
879  }
880};
881
882/// A Microsoft C++ @c __uuidof expression, which gets
883/// the _GUID that corresponds to the supplied type or expression.
884///
885/// This represents code like @c __uuidof(COMTYPE) or @c __uuidof(*comPtr)
886class CXXUuidofExpr : public Expr {
887private:
888  llvm::PointerUnion<Stmt *, TypeSourceInfo *> Operand;
889  StringRef UuidStr;
890  SourceRange Range;
891
892public:
893  CXXUuidofExpr(QualType TyTypeSourceInfo *OperandStringRef UuidStr,
894                SourceRange R)
895      : Expr(CXXUuidofExprClass, Ty, VK_LValue, OK_Ordinary, false,
896             Operand->getType()->isDependentType(),
897             Operand->getType()->isInstantiationDependentType(),
898             Operand->getType()->containsUnexpandedParameterPack()),
899        Operand(Operand), UuidStr(UuidStr), Range(R) {}
900
901  CXXUuidofExpr(QualType TyExpr *OperandStringRef UuidStrSourceRange R)
902      : Expr(CXXUuidofExprClass, Ty, VK_LValue, OK_Ordinary, false,
903             Operand->isTypeDependent(), Operand->isInstantiationDependent(),
904             Operand->containsUnexpandedParameterPack()),
905        Operand(Operand), UuidStr(UuidStr), Range(R) {}
906
907  CXXUuidofExpr(EmptyShell Emptybool isExpr)
908    : Expr(CXXUuidofExprClass, Empty) {
909    if (isExpr)
910      Operand = (Expr*)nullptr;
911    else
912      Operand = (TypeSourceInfo*)nullptr;
913  }
914
915  bool isTypeOperand() const { return Operand.is<TypeSourceInfo *>(); }
916
917  /// Retrieves the type operand of this __uuidof() expression after
918  /// various required adjustments (removing reference types, cv-qualifiers).
919  QualType getTypeOperand(ASTContext &Contextconst;
920
921  /// Retrieve source information for the type operand.
922  TypeSourceInfo *getTypeOperandSourceInfo() const {
923     (0) . __assert_fail ("isTypeOperand() && \"Cannot call getTypeOperand for __uuidof(expr)\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/ExprCXX.h", 923, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(isTypeOperand() && "Cannot call getTypeOperand for __uuidof(expr)");
924    return Operand.get<TypeSourceInfo *>();
925  }
926
927  void setTypeOperandSourceInfo(TypeSourceInfo *TSI) {
928     (0) . __assert_fail ("isTypeOperand() && \"Cannot call getTypeOperand for __uuidof(expr)\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/ExprCXX.h", 928, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(isTypeOperand() && "Cannot call getTypeOperand for __uuidof(expr)");
929    Operand = TSI;
930  }
931
932  Expr *getExprOperand() const {
933     (0) . __assert_fail ("!isTypeOperand() && \"Cannot call getExprOperand for __uuidof(type)\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/ExprCXX.h", 933, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(!isTypeOperand() && "Cannot call getExprOperand for __uuidof(type)");
934    return static_cast<Expr*>(Operand.get<Stmt *>());
935  }
936
937  void setExprOperand(Expr *E) {
938     (0) . __assert_fail ("!isTypeOperand() && \"Cannot call getExprOperand for __uuidof(type)\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/ExprCXX.h", 938, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(!isTypeOperand() && "Cannot call getExprOperand for __uuidof(type)");
939    Operand = E;
940  }
941
942  void setUuidStr(StringRef US) { UuidStr = US; }
943  StringRef getUuidStr() const { return UuidStr; }
944
945  SourceLocation getBeginLoc() const LLVM_READONLY { return Range.getBegin(); }
946  SourceLocation getEndLoc() const LLVM_READONLY { return Range.getEnd(); }
947  SourceRange getSourceRange() const LLVM_READONLY { return Range; }
948  void setSourceRange(SourceRange R) { Range = R; }
949
950  static bool classof(const Stmt *T) {
951    return T->getStmtClass() == CXXUuidofExprClass;
952  }
953
954  // Iterators
955  child_range children() {
956    if (isTypeOperand())
957      return child_range(child_iterator(), child_iterator());
958    auto **begin = reinterpret_cast<Stmt **>(&Operand);
959    return child_range(begin, begin + 1);
960  }
961};
962
963/// Represents the \c this expression in C++.
964///
965/// This is a pointer to the object on which the current member function is
966/// executing (C++ [expr.prim]p3). Example:
967///
968/// \code
969/// class Foo {
970/// public:
971///   void bar();
972///   void test() { this->bar(); }
973/// };
974/// \endcode
975class CXXThisExpr : public Expr {
976public:
977  CXXThisExpr(SourceLocation LQualType Tybool IsImplicit)
978      : Expr(CXXThisExprClass, Ty, VK_RValue, OK_Ordinary,
979             // 'this' is type-dependent if the class type of the enclosing
980             // member function is dependent (C++ [temp.dep.expr]p2)
981             Ty->isDependentType(), Ty->isDependentType(),
982             Ty->isInstantiationDependentType(),
983             /*ContainsUnexpandedParameterPack=*/false) {
984    CXXThisExprBits.IsImplicit = IsImplicit;
985    CXXThisExprBits.Loc = L;
986  }
987
988  CXXThisExpr(EmptyShell Empty) : Expr(CXXThisExprClass, Empty) {}
989
990  SourceLocation getLocation() const { return CXXThisExprBits.Loc; }
991  void setLocation(SourceLocation L) { CXXThisExprBits.Loc = L; }
992
993  SourceLocation getBeginLoc() const { return getLocation(); }
994  SourceLocation getEndLoc() const { return getLocation(); }
995
996  bool isImplicit() const { return CXXThisExprBits.IsImplicit; }
997  void setImplicit(bool I) { CXXThisExprBits.IsImplicit = I; }
998
999  static bool classof(const Stmt *T) {
1000    return T->getStmtClass() == CXXThisExprClass;
1001  }
1002
1003  // Iterators
1004  child_range children() {
1005    return child_range(child_iterator(), child_iterator());
1006  }
1007};
1008
1009/// A C++ throw-expression (C++ [except.throw]).
1010///
1011/// This handles 'throw' (for re-throwing the current exception) and
1012/// 'throw' assignment-expression.  When assignment-expression isn't
1013/// present, Op will be null.
1014class CXXThrowExpr : public Expr {
1015  friend class ASTStmtReader;
1016
1017  /// The optional expression in the throw statement.
1018  Stmt *Operand;
1019
1020public:
1021  // \p Ty is the void type which is used as the result type of the
1022  // expression. The \p Loc is the location of the throw keyword.
1023  // \p Operand is the expression in the throw statement, and can be
1024  // null if not present.
1025  CXXThrowExpr(Expr *OperandQualType TySourceLocation Loc,
1026               bool IsThrownVariableInScope)
1027      : Expr(CXXThrowExprClass, Ty, VK_RValue, OK_Ordinary, falsefalse,
1028             Operand && Operand->isInstantiationDependent(),
1029             Operand && Operand->containsUnexpandedParameterPack()),
1030        Operand(Operand) {
1031    CXXThrowExprBits.ThrowLoc = Loc;
1032    CXXThrowExprBits.IsThrownVariableInScope = IsThrownVariableInScope;
1033  }
1034  CXXThrowExpr(EmptyShell Empty) : Expr(CXXThrowExprClass, Empty) {}
1035
1036  const Expr *getSubExpr() const { return cast_or_null<Expr>(Operand); }
1037  Expr *getSubExpr() { return cast_or_null<Expr>(Operand); }
1038
1039  SourceLocation getThrowLoc() const { return CXXThrowExprBits.ThrowLoc; }
1040
1041  /// Determines whether the variable thrown by this expression (if any!)
1042  /// is within the innermost try block.
1043  ///
1044  /// This information is required to determine whether the NRVO can apply to
1045  /// this variable.
1046  bool isThrownVariableInScope() const {
1047    return CXXThrowExprBits.IsThrownVariableInScope;
1048  }
1049
1050  SourceLocation getBeginLoc() const { return getThrowLoc(); }
1051  SourceLocation getEndLoc() const LLVM_READONLY {
1052    if (!getSubExpr())
1053      return getThrowLoc();
1054    return getSubExpr()->getEndLoc();
1055  }
1056
1057  static bool classof(const Stmt *T) {
1058    return T->getStmtClass() == CXXThrowExprClass;
1059  }
1060
1061  // Iterators
1062  child_range children() {
1063    return child_range(&Operand, Operand ? &Operand + 1 : &Operand);
1064  }
1065};
1066
1067/// A default argument (C++ [dcl.fct.default]).
1068///
1069/// This wraps up a function call argument that was created from the
1070/// corresponding parameter's default argument, when the call did not
1071/// explicitly supply arguments for all of the parameters.
1072class CXXDefaultArgExpr final : public Expr {
1073  friend class ASTStmtReader;
1074
1075  /// The parameter whose default is being used.
1076  ParmVarDecl *Param;
1077
1078  CXXDefaultArgExpr(StmtClass SCSourceLocation LocParmVarDecl *Param)
1079      : Expr(SC,
1080             Param->hasUnparsedDefaultArg()
1081                 ? Param->getType().getNonReferenceType()
1082                 : Param->getDefaultArg()->getType(),
1083             Param->getDefaultArg()->getValueKind(),
1084             Param->getDefaultArg()->getObjectKind(), falsefalsefalse,
1085             false),
1086        Param(Param) {
1087    CXXDefaultArgExprBits.Loc = Loc;
1088  }
1089
1090public:
1091  CXXDefaultArgExpr(EmptyShell Empty) : Expr(CXXDefaultArgExprClass, Empty) {}
1092
1093  // \p Param is the parameter whose default argument is used by this
1094  // expression.
1095  static CXXDefaultArgExpr *Create(const ASTContext &CSourceLocation Loc,
1096                                   ParmVarDecl *Param) {
1097    return new (C) CXXDefaultArgExpr(CXXDefaultArgExprClass, Loc, Param);
1098  }
1099
1100  // Retrieve the parameter that the argument was created from.
1101  const ParmVarDecl *getParam() const { return Param; }
1102  ParmVarDecl *getParam() { return Param; }
1103
1104  // Retrieve the actual argument to the function call.
1105  const Expr *getExpr() const { return getParam()->getDefaultArg(); }
1106  Expr *getExpr() { return getParam()->getDefaultArg(); }
1107
1108  /// Retrieve the location where this default argument was actually used.
1109  SourceLocation getUsedLocation() const { return CXXDefaultArgExprBits.Loc; }
1110
1111  /// Default argument expressions have no representation in the
1112  /// source, so they have an empty source range.
1113  SourceLocation getBeginLoc() const { return SourceLocation(); }
1114  SourceLocation getEndLoc() const { return SourceLocation(); }
1115
1116  SourceLocation getExprLoc() const { return getUsedLocation(); }
1117
1118  static bool classof(const Stmt *T) {
1119    return T->getStmtClass() == CXXDefaultArgExprClass;
1120  }
1121
1122  // Iterators
1123  child_range children() {
1124    return child_range(child_iterator(), child_iterator());
1125  }
1126};
1127
1128/// A use of a default initializer in a constructor or in aggregate
1129/// initialization.
1130///
1131/// This wraps a use of a C++ default initializer (technically,
1132/// a brace-or-equal-initializer for a non-static data member) when it
1133/// is implicitly used in a mem-initializer-list in a constructor
1134/// (C++11 [class.base.init]p8) or in aggregate initialization
1135/// (C++1y [dcl.init.aggr]p7).
1136class CXXDefaultInitExpr : public Expr {
1137  friend class ASTReader;
1138  friend class ASTStmtReader;
1139
1140  /// The field whose default is being used.
1141  FieldDecl *Field;
1142
1143  CXXDefaultInitExpr(const ASTContext &CtxSourceLocation Loc,
1144                     FieldDecl *FieldQualType Ty);
1145
1146  CXXDefaultInitExpr(EmptyShell Empty) : Expr(CXXDefaultInitExprClass, Empty) {}
1147
1148public:
1149  /// \p Field is the non-static data member whose default initializer is used
1150  /// by this expression.
1151  static CXXDefaultInitExpr *Create(const ASTContext &CtxSourceLocation Loc,
1152                                    FieldDecl *Field) {
1153    return new (CtxCXXDefaultInitExpr(CtxLocFieldField->getType());
1154  }
1155
1156  /// Get the field whose initializer will be used.
1157  FieldDecl *getField() { return Field; }
1158  const FieldDecl *getField() const { return Field; }
1159
1160  /// Get the initialization expression that will be used.
1161  const Expr *getExpr() const {
1162     (0) . __assert_fail ("Field->getInClassInitializer() && \"initializer hasn't been parsed\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/ExprCXX.h", 1162, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(Field->getInClassInitializer() && "initializer hasn't been parsed");
1163    return Field->getInClassInitializer();
1164  }
1165  Expr *getExpr() {
1166     (0) . __assert_fail ("Field->getInClassInitializer() && \"initializer hasn't been parsed\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/ExprCXX.h", 1166, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(Field->getInClassInitializer() && "initializer hasn't been parsed");
1167    return Field->getInClassInitializer();
1168  }
1169
1170  SourceLocation getBeginLoc() const { return CXXDefaultInitExprBits.Loc; }
1171  SourceLocation getEndLoc() const { return CXXDefaultInitExprBits.Loc; }
1172
1173  static bool classof(const Stmt *T) {
1174    return T->getStmtClass() == CXXDefaultInitExprClass;
1175  }
1176
1177  // Iterators
1178  child_range children() {
1179    return child_range(child_iterator(), child_iterator());
1180  }
1181};
1182
1183/// Represents a C++ temporary.
1184class CXXTemporary {
1185  /// The destructor that needs to be called.
1186  const CXXDestructorDecl *Destructor;
1187
1188  explicit CXXTemporary(const CXXDestructorDecl *destructor)
1189      : Destructor(destructor) {}
1190
1191public:
1192  static CXXTemporary *Create(const ASTContext &C,
1193                              const CXXDestructorDecl *Destructor);
1194
1195  const CXXDestructorDecl *getDestructor() const { return Destructor; }
1196
1197  void setDestructor(const CXXDestructorDecl *Dtor) {
1198    Destructor = Dtor;
1199  }
1200};
1201
1202/// Represents binding an expression to a temporary.
1203///
1204/// This ensures the destructor is called for the temporary. It should only be
1205/// needed for non-POD, non-trivially destructable class types. For example:
1206///
1207/// \code
1208///   struct S {
1209///     S() { }  // User defined constructor makes S non-POD.
1210///     ~S() { } // User defined destructor makes it non-trivial.
1211///   };
1212///   void test() {
1213///     const S &s_ref = S(); // Requires a CXXBindTemporaryExpr.
1214///   }
1215/// \endcode
1216class CXXBindTemporaryExpr : public Expr {
1217  CXXTemporary *Temp = nullptr;
1218  Stmt *SubExpr = nullptr;
1219
1220  CXXBindTemporaryExpr(CXXTemporary *tempExprSubExpr)
1221      : Expr(CXXBindTemporaryExprClass, SubExpr->getType(),
1222             VK_RValue, OK_Ordinary, SubExpr->isTypeDependent(),
1223             SubExpr->isValueDependent(),
1224             SubExpr->isInstantiationDependent(),
1225             SubExpr->containsUnexpandedParameterPack()),
1226        Temp(temp), SubExpr(SubExpr) {}
1227
1228public:
1229  CXXBindTemporaryExpr(EmptyShell Empty)
1230      : Expr(CXXBindTemporaryExprClass, Empty) {}
1231
1232  static CXXBindTemporaryExpr *Create(const ASTContext &CCXXTemporary *Temp,
1233                                      ExprSubExpr);
1234
1235  CXXTemporary *getTemporary() { return Temp; }
1236  const CXXTemporary *getTemporary() const { return Temp; }
1237  void setTemporary(CXXTemporary *T) { Temp = T; }
1238
1239  const Expr *getSubExpr() const { return cast<Expr>(SubExpr); }
1240  Expr *getSubExpr() { return cast<Expr>(SubExpr); }
1241  void setSubExpr(Expr *E) { SubExpr = E; }
1242
1243  SourceLocation getBeginLoc() const LLVM_READONLY {
1244    return SubExpr->getBeginLoc();
1245  }
1246
1247  SourceLocation getEndLoc() const LLVM_READONLY {
1248    return SubExpr->getEndLoc();
1249  }
1250
1251  // Implement isa/cast/dyncast/etc.
1252  static bool classof(const Stmt *T) {
1253    return T->getStmtClass() == CXXBindTemporaryExprClass;
1254  }
1255
1256  // Iterators
1257  child_range children() { return child_range(&SubExpr, &SubExpr + 1); }
1258};
1259
1260/// Represents a call to a C++ constructor.
1261class CXXConstructExpr : public Expr {
1262  friend class ASTStmtReader;
1263
1264public:
1265  enum ConstructionKind {
1266    CK_Complete,
1267    CK_NonVirtualBase,
1268    CK_VirtualBase,
1269    CK_Delegating
1270  };
1271
1272private:
1273  /// A pointer to the constructor which will be ultimately called.
1274  CXXConstructorDecl *Constructor;
1275
1276  SourceRange ParenOrBraceRange;
1277
1278  /// The number of arguments.
1279  unsigned NumArgs;
1280
1281  // We would like to stash the arguments of the constructor call after
1282  // CXXConstructExpr. However CXXConstructExpr is used as a base class of
1283  // CXXTemporaryObjectExpr which makes the use of llvm::TrailingObjects
1284  // impossible.
1285  //
1286  // Instead we manually stash the trailing object after the full object
1287  // containing CXXConstructExpr (that is either CXXConstructExpr or
1288  // CXXTemporaryObjectExpr).
1289  //
1290  // The trailing objects are:
1291  //
1292  // * An array of getNumArgs() "Stmt *" for the arguments of the
1293  //   constructor call.
1294
1295  /// Return a pointer to the start of the trailing arguments.
1296  /// Defined just after CXXTemporaryObjectExpr.
1297  inline Stmt **getTrailingArgs();
1298  const Stmt *const *getTrailingArgs() const {
1299    return const_cast<CXXConstructExpr *>(this)->getTrailingArgs();
1300  }
1301
1302protected:
1303  /// Build a C++ construction expression.
1304  CXXConstructExpr(StmtClass SCQualType TySourceLocation Loc,
1305                   CXXConstructorDecl *Ctorbool Elidable,
1306                   ArrayRef<Expr *> Argsbool HadMultipleCandidates,
1307                   bool ListInitializationbool StdInitListInitialization,
1308                   bool ZeroInitializationConstructionKind ConstructKind,
1309                   SourceRange ParenOrBraceRange);
1310
1311  /// Build an empty C++ construction expression.
1312  CXXConstructExpr(StmtClass SCEmptyShell Emptyunsigned NumArgs);
1313
1314  /// Return the size in bytes of the trailing objects. Used by
1315  /// CXXTemporaryObjectExpr to allocate the right amount of storage.
1316  static unsigned sizeOfTrailingObjects(unsigned NumArgs) {
1317    return NumArgs * sizeof(Stmt *);
1318  }
1319
1320public:
1321  /// Create a C++ construction expression.
1322  static CXXConstructExpr *
1323  Create(const ASTContext &CtxQualType TySourceLocation Loc,
1324         CXXConstructorDecl *Ctorbool ElidableArrayRef<Expr *> Args,
1325         bool HadMultipleCandidatesbool ListInitialization,
1326         bool StdInitListInitializationbool ZeroInitialization,
1327         ConstructionKind ConstructKindSourceRange ParenOrBraceRange);
1328
1329  /// Create an empty C++ construction expression.
1330  static CXXConstructExpr *CreateEmpty(const ASTContext &Ctxunsigned NumArgs);
1331
1332  /// Get the constructor that this expression will (ultimately) call.
1333  CXXConstructorDecl *getConstructor() const { return Constructor; }
1334
1335  SourceLocation getLocation() const { return CXXConstructExprBits.Loc; }
1336  void setLocation(SourceLocation Loc) { CXXConstructExprBits.Loc = Loc; }
1337
1338  /// Whether this construction is elidable.
1339  bool isElidable() const { return CXXConstructExprBits.Elidable; }
1340  void setElidable(bool E) { CXXConstructExprBits.Elidable = E; }
1341
1342  /// Whether the referred constructor was resolved from
1343  /// an overloaded set having size greater than 1.
1344  bool hadMultipleCandidates() const {
1345    return CXXConstructExprBits.HadMultipleCandidates;
1346  }
1347  void setHadMultipleCandidates(bool V) {
1348    CXXConstructExprBits.HadMultipleCandidates = V;
1349  }
1350
1351  /// Whether this constructor call was written as list-initialization.
1352  bool isListInitialization() const {
1353    return CXXConstructExprBits.ListInitialization;
1354  }
1355  void setListInitialization(bool V) {
1356    CXXConstructExprBits.ListInitialization = V;
1357  }
1358
1359  /// Whether this constructor call was written as list-initialization,
1360  /// but was interpreted as forming a std::initializer_list<T> from the list
1361  /// and passing that as a single constructor argument.
1362  /// See C++11 [over.match.list]p1 bullet 1.
1363  bool isStdInitListInitialization() const {
1364    return CXXConstructExprBits.StdInitListInitialization;
1365  }
1366  void setStdInitListInitialization(bool V) {
1367    CXXConstructExprBits.StdInitListInitialization = V;
1368  }
1369
1370  /// Whether this construction first requires
1371  /// zero-initialization before the initializer is called.
1372  bool requiresZeroInitialization() const {
1373    return CXXConstructExprBits.ZeroInitialization;
1374  }
1375  void setRequiresZeroInitialization(bool ZeroInit) {
1376    CXXConstructExprBits.ZeroInitialization = ZeroInit;
1377  }
1378
1379  /// Determine whether this constructor is actually constructing
1380  /// a base class (rather than a complete object).
1381  ConstructionKind getConstructionKind() const {
1382    return static_cast<ConstructionKind>(CXXConstructExprBits.ConstructionKind);
1383  }
1384  void setConstructionKind(ConstructionKind CK) {
1385    CXXConstructExprBits.ConstructionKind = CK;
1386  }
1387
1388  using arg_iterator = ExprIterator;
1389  using const_arg_iterator = ConstExprIterator;
1390  using arg_range = llvm::iterator_range<arg_iterator>;
1391  using const_arg_range = llvm::iterator_range<const_arg_iterator>;
1392
1393  arg_range arguments() { return arg_range(arg_begin(), arg_end()); }
1394  const_arg_range arguments() const {
1395    return const_arg_range(arg_begin(), arg_end());
1396  }
1397
1398  arg_iterator arg_begin() { return getTrailingArgs(); }
1399  arg_iterator arg_end() { return arg_begin() + getNumArgs(); }
1400  const_arg_iterator arg_begin() const { return getTrailingArgs(); }
1401  const_arg_iterator arg_end() const { return arg_begin() + getNumArgs(); }
1402
1403  Expr **getArgs() { return reinterpret_cast<Expr **>(getTrailingArgs()); }
1404  const Expr *const *getArgs() const {
1405    return reinterpret_cast<const Expr *const *>(getTrailingArgs());
1406  }
1407
1408  /// Return the number of arguments to the constructor call.
1409  unsigned getNumArgs() const { return NumArgs; }
1410
1411  /// Return the specified argument.
1412  Expr *getArg(unsigned Arg) {
1413     (0) . __assert_fail ("Arg < getNumArgs() && \"Arg access out of range!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/ExprCXX.h", 1413, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(Arg < getNumArgs() && "Arg access out of range!");
1414    return getArgs()[Arg];
1415  }
1416  const Expr *getArg(unsigned Argconst {
1417     (0) . __assert_fail ("Arg < getNumArgs() && \"Arg access out of range!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/ExprCXX.h", 1417, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(Arg < getNumArgs() && "Arg access out of range!");
1418    return getArgs()[Arg];
1419  }
1420
1421  /// Set the specified argument.
1422  void setArg(unsigned ArgExpr *ArgExpr) {
1423     (0) . __assert_fail ("Arg < getNumArgs() && \"Arg access out of range!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/ExprCXX.h", 1423, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(Arg < getNumArgs() && "Arg access out of range!");
1424    getArgs()[Arg] = ArgExpr;
1425  }
1426
1427  SourceLocation getBeginLoc() const LLVM_READONLY;
1428  SourceLocation getEndLoc() const LLVM_READONLY;
1429  SourceRange getParenOrBraceRange() const { return ParenOrBraceRange; }
1430  void setParenOrBraceRange(SourceRange Range) { ParenOrBraceRange = Range; }
1431
1432  static bool classof(const Stmt *T) {
1433    return T->getStmtClass() == CXXConstructExprClass ||
1434           T->getStmtClass() == CXXTemporaryObjectExprClass;
1435  }
1436
1437  // Iterators
1438  child_range children() {
1439    return child_range(getTrailingArgs(), getTrailingArgs() + getNumArgs());
1440  }
1441};
1442
1443/// Represents a call to an inherited base class constructor from an
1444/// inheriting constructor. This call implicitly forwards the arguments from
1445/// the enclosing context (an inheriting constructor) to the specified inherited
1446/// base class constructor.
1447class CXXInheritedCtorInitExpr : public Expr {
1448private:
1449  CXXConstructorDecl *Constructor = nullptr;
1450
1451  /// The location of the using declaration.
1452  SourceLocation Loc;
1453
1454  /// Whether this is the construction of a virtual base.
1455  unsigned ConstructsVirtualBase : 1;
1456
1457  /// Whether the constructor is inherited from a virtual base class of the
1458  /// class that we construct.
1459  unsigned InheritedFromVirtualBase : 1;
1460
1461public:
1462  friend class ASTStmtReader;
1463
1464  /// Construct a C++ inheriting construction expression.
1465  CXXInheritedCtorInitExpr(SourceLocation LocQualType T,
1466                           CXXConstructorDecl *Ctorbool ConstructsVirtualBase,
1467                           bool InheritedFromVirtualBase)
1468      : Expr(CXXInheritedCtorInitExprClass, T, VK_RValue, OK_Ordinary, false,
1469             falsefalsefalse),
1470        Constructor(Ctor), Loc(Loc),
1471        ConstructsVirtualBase(ConstructsVirtualBase),
1472        InheritedFromVirtualBase(InheritedFromVirtualBase) {
1473    isDependentType()", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/ExprCXX.h", 1473, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(!T->isDependentType());
1474  }
1475
1476  /// Construct an empty C++ inheriting construction expression.
1477  explicit CXXInheritedCtorInitExpr(EmptyShell Empty)
1478      : Expr(CXXInheritedCtorInitExprClass, Empty),
1479        ConstructsVirtualBase(false), InheritedFromVirtualBase(false) {}
1480
1481  /// Get the constructor that this expression will call.
1482  CXXConstructorDecl *getConstructor() const { return Constructor; }
1483
1484  /// Determine whether this constructor is actually constructing
1485  /// a base class (rather than a complete object).
1486  bool constructsVBase() const { return ConstructsVirtualBase; }
1487  CXXConstructExpr::ConstructionKind getConstructionKind() const {
1488    return ConstructsVirtualBase ? CXXConstructExpr::CK_VirtualBase
1489                                 : CXXConstructExpr::CK_NonVirtualBase;
1490  }
1491
1492  /// Determine whether the inherited constructor is inherited from a
1493  /// virtual base of the object we construct. If so, we are not responsible
1494  /// for calling the inherited constructor (the complete object constructor
1495  /// does that), and so we don't need to pass any arguments.
1496  bool inheritedFromVBase() const { return InheritedFromVirtualBase; }
1497
1498  SourceLocation getLocation() const LLVM_READONLY { return Loc; }
1499  SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; }
1500  SourceLocation getEndLoc() const LLVM_READONLY { return Loc; }
1501
1502  static bool classof(const Stmt *T) {
1503    return T->getStmtClass() == CXXInheritedCtorInitExprClass;
1504  }
1505
1506  child_range children() {
1507    return child_range(child_iterator(), child_iterator());
1508  }
1509};
1510
1511/// Represents an explicit C++ type conversion that uses "functional"
1512/// notation (C++ [expr.type.conv]).
1513///
1514/// Example:
1515/// \code
1516///   x = int(0.5);
1517/// \endcode
1518class CXXFunctionalCastExpr final
1519    : public ExplicitCastExpr,
1520      private llvm::TrailingObjects<CXXFunctionalCastExpr, CXXBaseSpecifier *> {
1521  SourceLocation LParenLoc;
1522  SourceLocation RParenLoc;
1523
1524  CXXFunctionalCastExpr(QualType tyExprValueKind VK,
1525                        TypeSourceInfo *writtenTy,
1526                        CastKind kindExpr *castExprunsigned pathSize,
1527                        SourceLocation lParenLocSourceLocation rParenLoc)
1528      : ExplicitCastExpr(CXXFunctionalCastExprClass, ty, VK, kind,
1529                         castExpr, pathSize, writtenTy),
1530        LParenLoc(lParenLoc), RParenLoc(rParenLoc) {}
1531
1532  explicit CXXFunctionalCastExpr(EmptyShell Shellunsigned PathSize)
1533      : ExplicitCastExpr(CXXFunctionalCastExprClass, Shell, PathSize) {}
1534
1535public:
1536  friend class CastExpr;
1537  friend TrailingObjects;
1538
1539  static CXXFunctionalCastExpr *Create(const ASTContext &ContextQualType T,
1540                                       ExprValueKind VK,
1541                                       TypeSourceInfo *Written,
1542                                       CastKind KindExpr *Op,
1543                                       const CXXCastPath *Path,
1544                                       SourceLocation LPLoc,
1545                                       SourceLocation RPLoc);
1546  static CXXFunctionalCastExpr *CreateEmpty(const ASTContext &Context,
1547                                            unsigned PathSize);
1548
1549  SourceLocation getLParenLoc() const { return LParenLoc; }
1550  void setLParenLoc(SourceLocation L) { LParenLoc = L; }
1551  SourceLocation getRParenLoc() const { return RParenLoc; }
1552  void setRParenLoc(SourceLocation L) { RParenLoc = L; }
1553
1554  /// Determine whether this expression models list-initialization.
1555  bool isListInitialization() const { return LParenLoc.isInvalid(); }
1556
1557  SourceLocation getBeginLoc() const LLVM_READONLY;
1558  SourceLocation getEndLoc() const LLVM_READONLY;
1559
1560  static bool classof(const Stmt *T) {
1561    return T->getStmtClass() == CXXFunctionalCastExprClass;
1562  }
1563};
1564
1565/// Represents a C++ functional cast expression that builds a
1566/// temporary object.
1567///
1568/// This expression type represents a C++ "functional" cast
1569/// (C++[expr.type.conv]) with N != 1 arguments that invokes a
1570/// constructor to build a temporary object. With N == 1 arguments the
1571/// functional cast expression will be represented by CXXFunctionalCastExpr.
1572/// Example:
1573/// \code
1574/// struct X { X(int, float); }
1575///
1576/// X create_X() {
1577///   return X(1, 3.14f); // creates a CXXTemporaryObjectExpr
1578/// };
1579/// \endcode
1580class CXXTemporaryObjectExpr final : public CXXConstructExpr {
1581  friend class ASTStmtReader;
1582
1583  // CXXTemporaryObjectExpr has some trailing objects belonging
1584  // to CXXConstructExpr. See the comment inside CXXConstructExpr
1585  // for more details.
1586
1587  TypeSourceInfo *TSI;
1588
1589  CXXTemporaryObjectExpr(CXXConstructorDecl *ConsQualType Ty,
1590                         TypeSourceInfo *TSIArrayRef<Expr *> Args,
1591                         SourceRange ParenOrBraceRange,
1592                         bool HadMultipleCandidatesbool ListInitialization,
1593                         bool StdInitListInitialization,
1594                         bool ZeroInitialization);
1595
1596  CXXTemporaryObjectExpr(EmptyShell Emptyunsigned NumArgs);
1597
1598public:
1599  static CXXTemporaryObjectExpr *
1600  Create(const ASTContext &CtxCXXConstructorDecl *ConsQualType Ty,
1601         TypeSourceInfo *TSIArrayRef<Expr *> Args,
1602         SourceRange ParenOrBraceRangebool HadMultipleCandidates,
1603         bool ListInitializationbool StdInitListInitialization,
1604         bool ZeroInitialization);
1605
1606  static CXXTemporaryObjectExpr *CreateEmpty(const ASTContext &Ctx,
1607                                             unsigned NumArgs);
1608
1609  TypeSourceInfo *getTypeSourceInfo() const { return TSI; }
1610
1611  SourceLocation getBeginLoc() const LLVM_READONLY;
1612  SourceLocation getEndLoc() const LLVM_READONLY;
1613
1614  static bool classof(const Stmt *T) {
1615    return T->getStmtClass() == CXXTemporaryObjectExprClass;
1616  }
1617};
1618
1619Stmt **CXXConstructExpr::getTrailingArgs() {
1620  if (auto *E = dyn_cast<CXXTemporaryObjectExpr>(this))
1621    return reinterpret_cast<Stmt **>(E + 1);
1622   (0) . __assert_fail ("(getStmtClass() == CXXConstructExprClass) && \"Unexpected class deriving from CXXConstructExpr!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/ExprCXX.h", 1623, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert((getStmtClass() == CXXConstructExprClass) &&
1623 (0) . __assert_fail ("(getStmtClass() == CXXConstructExprClass) && \"Unexpected class deriving from CXXConstructExpr!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/ExprCXX.h", 1623, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">         "Unexpected class deriving from CXXConstructExpr!");
1624  return reinterpret_cast<Stmt **>(this + 1);
1625}
1626
1627/// A C++ lambda expression, which produces a function object
1628/// (of unspecified type) that can be invoked later.
1629///
1630/// Example:
1631/// \code
1632/// void low_pass_filter(std::vector<double> &values, double cutoff) {
1633///   values.erase(std::remove_if(values.begin(), values.end(),
1634///                               [=](double value) { return value > cutoff; });
1635/// }
1636/// \endcode
1637///
1638/// C++11 lambda expressions can capture local variables, either by copying
1639/// the values of those local variables at the time the function
1640/// object is constructed (not when it is called!) or by holding a
1641/// reference to the local variable. These captures can occur either
1642/// implicitly or can be written explicitly between the square
1643/// brackets ([...]) that start the lambda expression.
1644///
1645/// C++1y introduces a new form of "capture" called an init-capture that
1646/// includes an initializing expression (rather than capturing a variable),
1647/// and which can never occur implicitly.
1648class LambdaExpr final : public Expr,
1649                         private llvm::TrailingObjects<LambdaExpr, Stmt *> {
1650  /// The source range that covers the lambda introducer ([...]).
1651  SourceRange IntroducerRange;
1652
1653  /// The source location of this lambda's capture-default ('=' or '&').
1654  SourceLocation CaptureDefaultLoc;
1655
1656  /// The number of captures.
1657  unsigned NumCaptures : 16;
1658
1659  /// The default capture kind, which is a value of type
1660  /// LambdaCaptureDefault.
1661  unsigned CaptureDefault : 2;
1662
1663  /// Whether this lambda had an explicit parameter list vs. an
1664  /// implicit (and empty) parameter list.
1665  unsigned ExplicitParams : 1;
1666
1667  /// Whether this lambda had the result type explicitly specified.
1668  unsigned ExplicitResultType : 1;
1669
1670  /// The location of the closing brace ('}') that completes
1671  /// the lambda.
1672  ///
1673  /// The location of the brace is also available by looking up the
1674  /// function call operator in the lambda class. However, it is
1675  /// stored here to improve the performance of getSourceRange(), and
1676  /// to avoid having to deserialize the function call operator from a
1677  /// module file just to determine the source range.
1678  SourceLocation ClosingBrace;
1679
1680  /// Construct a lambda expression.
1681  LambdaExpr(QualType TSourceRange IntroducerRange,
1682             LambdaCaptureDefault CaptureDefault,
1683             SourceLocation CaptureDefaultLocArrayRef<LambdaCaptureCaptures,
1684             bool ExplicitParamsbool ExplicitResultType,
1685             ArrayRef<Expr *> CaptureInitsSourceLocation ClosingBrace,
1686             bool ContainsUnexpandedParameterPack);
1687
1688  /// Construct an empty lambda expression.
1689  LambdaExpr(EmptyShell Emptyunsigned NumCaptures)
1690      : Expr(LambdaExprClass, Empty), NumCaptures(NumCaptures),
1691        CaptureDefault(LCD_None), ExplicitParams(false),
1692        ExplicitResultType(false) {
1693    getStoredStmts()[NumCaptures] = nullptr;
1694  }
1695
1696  Stmt **getStoredStmts() { return getTrailingObjects<Stmt *>(); }
1697
1698  Stmt *const *getStoredStmts() const { return getTrailingObjects<Stmt *>(); }
1699
1700public:
1701  friend class ASTStmtReader;
1702  friend class ASTStmtWriter;
1703  friend TrailingObjects;
1704
1705  /// Construct a new lambda expression.
1706  static LambdaExpr *
1707  Create(const ASTContext &CCXXRecordDecl *ClassSourceRange IntroducerRange,
1708         LambdaCaptureDefault CaptureDefaultSourceLocation CaptureDefaultLoc,
1709         ArrayRef<LambdaCaptureCapturesbool ExplicitParams,
1710         bool ExplicitResultTypeArrayRef<Expr *> CaptureInits,
1711         SourceLocation ClosingBracebool ContainsUnexpandedParameterPack);
1712
1713  /// Construct a new lambda expression that will be deserialized from
1714  /// an external source.
1715  static LambdaExpr *CreateDeserialized(const ASTContext &C,
1716                                        unsigned NumCaptures);
1717
1718  /// Determine the default capture kind for this lambda.
1719  LambdaCaptureDefault getCaptureDefault() const {
1720    return static_cast<LambdaCaptureDefault>(CaptureDefault);
1721  }
1722
1723  /// Retrieve the location of this lambda's capture-default, if any.
1724  SourceLocation getCaptureDefaultLoc() const {
1725    return CaptureDefaultLoc;
1726  }
1727
1728  /// Determine whether one of this lambda's captures is an init-capture.
1729  bool isInitCapture(const LambdaCapture *Captureconst;
1730
1731  /// An iterator that walks over the captures of the lambda,
1732  /// both implicit and explicit.
1733  using capture_iterator = const LambdaCapture *;
1734
1735  /// An iterator over a range of lambda captures.
1736  using capture_range = llvm::iterator_range<capture_iterator>;
1737
1738  /// Retrieve this lambda's captures.
1739  capture_range captures() const;
1740
1741  /// Retrieve an iterator pointing to the first lambda capture.
1742  capture_iterator capture_begin() const;
1743
1744  /// Retrieve an iterator pointing past the end of the
1745  /// sequence of lambda captures.
1746  capture_iterator capture_end() const;
1747
1748  /// Determine the number of captures in this lambda.
1749  unsigned capture_size() const { return NumCaptures; }
1750
1751  /// Retrieve this lambda's explicit captures.
1752  capture_range explicit_captures() const;
1753
1754  /// Retrieve an iterator pointing to the first explicit
1755  /// lambda capture.
1756  capture_iterator explicit_capture_begin() const;
1757
1758  /// Retrieve an iterator pointing past the end of the sequence of
1759  /// explicit lambda captures.
1760  capture_iterator explicit_capture_end() const;
1761
1762  /// Retrieve this lambda's implicit captures.
1763  capture_range implicit_captures() const;
1764
1765  /// Retrieve an iterator pointing to the first implicit
1766  /// lambda capture.
1767  capture_iterator implicit_capture_begin() const;
1768
1769  /// Retrieve an iterator pointing past the end of the sequence of
1770  /// implicit lambda captures.
1771  capture_iterator implicit_capture_end() const;
1772
1773  /// Iterator that walks over the capture initialization
1774  /// arguments.
1775  using capture_init_iterator = Expr **;
1776
1777  /// Const iterator that walks over the capture initialization
1778  /// arguments.
1779  using const_capture_init_iterator = Expr *const *;
1780
1781  /// Retrieve the initialization expressions for this lambda's captures.
1782  llvm::iterator_range<capture_init_iterator> capture_inits() {
1783    return llvm::make_range(capture_init_begin(), capture_init_end());
1784  }
1785
1786  /// Retrieve the initialization expressions for this lambda's captures.
1787  llvm::iterator_range<const_capture_init_iterator> capture_inits() const {
1788    return llvm::make_range(capture_init_begin(), capture_init_end());
1789  }
1790
1791  /// Retrieve the first initialization argument for this
1792  /// lambda expression (which initializes the first capture field).
1793  capture_init_iterator capture_init_begin() {
1794    return reinterpret_cast<Expr **>(getStoredStmts());
1795  }
1796
1797  /// Retrieve the first initialization argument for this
1798  /// lambda expression (which initializes the first capture field).
1799  const_capture_init_iterator capture_init_begin() const {
1800    return reinterpret_cast<Expr *const *>(getStoredStmts());
1801  }
1802
1803  /// Retrieve the iterator pointing one past the last
1804  /// initialization argument for this lambda expression.
1805  capture_init_iterator capture_init_end() {
1806    return capture_init_begin() + NumCaptures;
1807  }
1808
1809  /// Retrieve the iterator pointing one past the last
1810  /// initialization argument for this lambda expression.
1811  const_capture_init_iterator capture_init_end() const {
1812    return capture_init_begin() + NumCaptures;
1813  }
1814
1815  /// Retrieve the source range covering the lambda introducer,
1816  /// which contains the explicit capture list surrounded by square
1817  /// brackets ([...]).
1818  SourceRange getIntroducerRange() const { return IntroducerRange; }
1819
1820  /// Retrieve the class that corresponds to the lambda.
1821  ///
1822  /// This is the "closure type" (C++1y [expr.prim.lambda]), and stores the
1823  /// captures in its fields and provides the various operations permitted
1824  /// on a lambda (copying, calling).
1825  CXXRecordDecl *getLambdaClass() const;
1826
1827  /// Retrieve the function call operator associated with this
1828  /// lambda expression.
1829  CXXMethodDecl *getCallOperator() const;
1830
1831  /// If this is a generic lambda expression, retrieve the template
1832  /// parameter list associated with it, or else return null.
1833  TemplateParameterList *getTemplateParameterList() const;
1834
1835  /// Whether this is a generic lambda.
1836  bool isGenericLambda() const { return getTemplateParameterList(); }
1837
1838  /// Retrieve the body of the lambda.
1839  CompoundStmt *getBody() const;
1840
1841  /// Determine whether the lambda is mutable, meaning that any
1842  /// captures values can be modified.
1843  bool isMutable() const;
1844
1845  /// Determine whether this lambda has an explicit parameter
1846  /// list vs. an implicit (empty) parameter list.
1847  bool hasExplicitParameters() const { return ExplicitParams; }
1848
1849  /// Whether this lambda had its result type explicitly specified.
1850  bool hasExplicitResultType() const { return ExplicitResultType; }
1851
1852  static bool classof(const Stmt *T) {
1853    return T->getStmtClass() == LambdaExprClass;
1854  }
1855
1856  SourceLocation getBeginLoc() const LLVM_READONLY {
1857    return IntroducerRange.getBegin();
1858  }
1859
1860  SourceLocation getEndLoc() const LLVM_READONLY { return ClosingBrace; }
1861
1862  child_range children() {
1863    // Includes initialization exprs plus body stmt
1864    return child_range(getStoredStmts(), getStoredStmts() + NumCaptures + 1);
1865  }
1866};
1867
1868/// An expression "T()" which creates a value-initialized rvalue of type
1869/// T, which is a non-class type.  See (C++98 [5.2.3p2]).
1870class CXXScalarValueInitExpr : public Expr {
1871  friend class ASTStmtReader;
1872
1873  TypeSourceInfo *TypeInfo;
1874
1875public:
1876  /// Create an explicitly-written scalar-value initialization
1877  /// expression.
1878  CXXScalarValueInitExpr(QualType TypeTypeSourceInfo *TypeInfo,
1879                         SourceLocation RParenLoc)
1880      : Expr(CXXScalarValueInitExprClass, Type, VK_RValue, OK_Ordinary, false,
1881             false, Type->isInstantiationDependentType(),
1882             Type->containsUnexpandedParameterPack()),
1883        TypeInfo(TypeInfo) {
1884    CXXScalarValueInitExprBits.RParenLoc = RParenLoc;
1885  }
1886
1887  explicit CXXScalarValueInitExpr(EmptyShell Shell)
1888      : Expr(CXXScalarValueInitExprClass, Shell) {}
1889
1890  TypeSourceInfo *getTypeSourceInfo() const {
1891    return TypeInfo;
1892  }
1893
1894  SourceLocation getRParenLoc() const {
1895    return CXXScalarValueInitExprBits.RParenLoc;
1896  }
1897
1898  SourceLocation getBeginLoc() const LLVM_READONLY;
1899  SourceLocation getEndLoc() const { return getRParenLoc(); }
1900
1901  static bool classof(const Stmt *T) {
1902    return T->getStmtClass() == CXXScalarValueInitExprClass;
1903  }
1904
1905  // Iterators
1906  child_range children() {
1907    return child_range(child_iterator(), child_iterator());
1908  }
1909};
1910
1911/// Represents a new-expression for memory allocation and constructor
1912/// calls, e.g: "new CXXNewExpr(foo)".
1913class CXXNewExpr final
1914    : public Expr,
1915      private llvm::TrailingObjects<CXXNewExpr, Stmt *, SourceRange> {
1916  friend class ASTStmtReader;
1917  friend class ASTStmtWriter;
1918  friend TrailingObjects;
1919
1920  /// Points to the allocation function used.
1921  FunctionDecl *OperatorNew;
1922
1923  /// Points to the deallocation function used in case of error. May be null.
1924  FunctionDecl *OperatorDelete;
1925
1926  /// The allocated type-source information, as written in the source.
1927  TypeSourceInfo *AllocatedTypeInfo;
1928
1929  /// Range of the entire new expression.
1930  SourceRange Range;
1931
1932  /// Source-range of a paren-delimited initializer.
1933  SourceRange DirectInitRange;
1934
1935  // CXXNewExpr is followed by several optional trailing objects.
1936  // They are in order:
1937  //
1938  // * An optional "Stmt *" for the array size expression.
1939  //    Present if and ony if isArray().
1940  //
1941  // * An optional "Stmt *" for the init expression.
1942  //    Present if and only if hasInitializer().
1943  //
1944  // * An array of getNumPlacementArgs() "Stmt *" for the placement new
1945  //   arguments, if any.
1946  //
1947  // * An optional SourceRange for the range covering the parenthesized type-id
1948  //    if the allocated type was expressed as a parenthesized type-id.
1949  //    Present if and only if isParenTypeId().
1950  unsigned arraySizeOffset() const { return 0; }
1951  unsigned initExprOffset() const { return arraySizeOffset() + isArray(); }
1952  unsigned placementNewArgsOffset() const {
1953    return initExprOffset() + hasInitializer();
1954  }
1955
1956  unsigned numTrailingObjects(OverloadToken<Stmt *>) const {
1957    return isArray() + hasInitializer() + getNumPlacementArgs();
1958  }
1959
1960  unsigned numTrailingObjects(OverloadToken<SourceRange>) const {
1961    return isParenTypeId();
1962  }
1963
1964public:
1965  enum InitializationStyle {
1966    /// New-expression has no initializer as written.
1967    NoInit,
1968
1969    /// New-expression has a C++98 paren-delimited initializer.
1970    CallInit,
1971
1972    /// New-expression has a C++11 list-initializer.
1973    ListInit
1974  };
1975
1976private:
1977  /// Build a c++ new expression.
1978  CXXNewExpr(bool IsGlobalNewFunctionDecl *OperatorNew,
1979             FunctionDecl *OperatorDeletebool ShouldPassAlignment,
1980             bool UsualArrayDeleteWantsSizeArrayRef<Expr *> PlacementArgs,
1981             SourceRange TypeIdParensExpr *ArraySize,
1982             InitializationStyle InitializationStyleExpr *Initializer,
1983             QualType TyTypeSourceInfo *AllocatedTypeInfoSourceRange Range,
1984             SourceRange DirectInitRange);
1985
1986  /// Build an empty c++ new expression.
1987  CXXNewExpr(EmptyShell Emptybool IsArrayunsigned NumPlacementArgs,
1988             bool IsParenTypeId);
1989
1990public:
1991  /// Create a c++ new expression.
1992  static CXXNewExpr *
1993  Create(const ASTContext &Ctxbool IsGlobalNewFunctionDecl *OperatorNew,
1994         FunctionDecl *OperatorDeletebool ShouldPassAlignment,
1995         bool UsualArrayDeleteWantsSizeArrayRef<Expr *> PlacementArgs,
1996         SourceRange TypeIdParensExpr *ArraySize,
1997         InitializationStyle InitializationStyleExpr *Initializer,
1998         QualType TyTypeSourceInfo *AllocatedTypeInfoSourceRange Range,
1999         SourceRange DirectInitRange);
2000
2001  /// Create an empty c++ new expression.
2002  static CXXNewExpr *CreateEmpty(const ASTContext &Ctxbool IsArray,
2003                                 bool HasInitunsigned NumPlacementArgs,
2004                                 bool IsParenTypeId);
2005
2006  QualType getAllocatedType() const {
2007    isPointerType()", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/ExprCXX.h", 2007, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(getType()->isPointerType());
2008    return getType()->getAs<PointerType>()->getPointeeType();
2009  }
2010
2011  TypeSourceInfo *getAllocatedTypeSourceInfo() const {
2012    return AllocatedTypeInfo;
2013  }
2014
2015  /// True if the allocation result needs to be null-checked.
2016  ///
2017  /// C++11 [expr.new]p13:
2018  ///   If the allocation function returns null, initialization shall
2019  ///   not be done, the deallocation function shall not be called,
2020  ///   and the value of the new-expression shall be null.
2021  ///
2022  /// C++ DR1748:
2023  ///   If the allocation function is a reserved placement allocation
2024  ///   function that returns null, the behavior is undefined.
2025  ///
2026  /// An allocation function is not allowed to return null unless it
2027  /// has a non-throwing exception-specification.  The '03 rule is
2028  /// identical except that the definition of a non-throwing
2029  /// exception specification is just "is it throw()?".
2030  bool shouldNullCheckAllocation() const;
2031
2032  FunctionDecl *getOperatorNew() const { return OperatorNew; }
2033  void setOperatorNew(FunctionDecl *D) { OperatorNew = D; }
2034  FunctionDecl *getOperatorDelete() const { return OperatorDelete; }
2035  void setOperatorDelete(FunctionDecl *D) { OperatorDelete = D; }
2036
2037  bool isArray() const { return CXXNewExprBits.IsArray; }
2038
2039  Expr *getArraySize() {
2040    return isArray()
2041               ? cast<Expr>(getTrailingObjects<Stmt *>()[arraySizeOffset()])
2042               : nullptr;
2043  }
2044  const Expr *getArraySize() const {
2045    return isArray()
2046               ? cast<Expr>(getTrailingObjects<Stmt *>()[arraySizeOffset()])
2047               : nullptr;
2048  }
2049
2050  unsigned getNumPlacementArgs() const {
2051    return CXXNewExprBits.NumPlacementArgs;
2052  }
2053
2054  Expr **getPlacementArgs() {
2055    return reinterpret_cast<Expr **>(getTrailingObjects<Stmt *>() +
2056                                     placementNewArgsOffset());
2057  }
2058
2059  Expr *getPlacementArg(unsigned I) {
2060     (0) . __assert_fail ("(I < getNumPlacementArgs()) && \"Index out of range!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/ExprCXX.h", 2060, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert((I < getNumPlacementArgs()) && "Index out of range!");
2061    return getPlacementArgs()[I];
2062  }
2063  const Expr *getPlacementArg(unsigned Iconst {
2064    return const_cast<CXXNewExpr *>(this)->getPlacementArg(I);
2065  }
2066
2067  bool isParenTypeId() const { return CXXNewExprBits.IsParenTypeId; }
2068  SourceRange getTypeIdParens() const {
2069    return isParenTypeId() ? getTrailingObjects<SourceRange>()[0]
2070                           : SourceRange();
2071  }
2072
2073  bool isGlobalNew() const { return CXXNewExprBits.IsGlobalNew; }
2074
2075  /// Whether this new-expression has any initializer at all.
2076  bool hasInitializer() const {
2077    return CXXNewExprBits.StoredInitializationStyle > 0;
2078  }
2079
2080  /// The kind of initializer this new-expression has.
2081  InitializationStyle getInitializationStyle() const {
2082    if (CXXNewExprBits.StoredInitializationStyle == 0)
2083      return NoInit;
2084    return static_cast<InitializationStyle>(
2085        CXXNewExprBits.StoredInitializationStyle - 1);
2086  }
2087
2088  /// The initializer of this new-expression.
2089  Expr *getInitializer() {
2090    return hasInitializer()
2091               ? cast<Expr>(getTrailingObjects<Stmt *>()[initExprOffset()])
2092               : nullptr;
2093  }
2094  const Expr *getInitializer() const {
2095    return hasInitializer()
2096               ? cast<Expr>(getTrailingObjects<Stmt *>()[initExprOffset()])
2097               : nullptr;
2098  }
2099
2100  /// Returns the CXXConstructExpr from this new-expression, or null.
2101  const CXXConstructExpr *getConstructExpr() const {
2102    return dyn_cast_or_null<CXXConstructExpr>(getInitializer());
2103  }
2104
2105  /// Indicates whether the required alignment should be implicitly passed to
2106  /// the allocation function.
2107  bool passAlignment() const { return CXXNewExprBits.ShouldPassAlignment; }
2108
2109  /// Answers whether the usual array deallocation function for the
2110  /// allocated type expects the size of the allocation as a
2111  /// parameter.
2112  bool doesUsualArrayDeleteWantSize() const {
2113    return CXXNewExprBits.UsualArrayDeleteWantsSize;
2114  }
2115
2116  using arg_iterator = ExprIterator;
2117  using const_arg_iterator = ConstExprIterator;
2118
2119  llvm::iterator_range<arg_iterator> placement_arguments() {
2120    return llvm::make_range(placement_arg_begin(), placement_arg_end());
2121  }
2122
2123  llvm::iterator_range<const_arg_iterator> placement_arguments() const {
2124    return llvm::make_range(placement_arg_begin(), placement_arg_end());
2125  }
2126
2127  arg_iterator placement_arg_begin() {
2128    return getTrailingObjects<Stmt *>() + placementNewArgsOffset();
2129  }
2130  arg_iterator placement_arg_end() {
2131    return placement_arg_begin() + getNumPlacementArgs();
2132  }
2133  const_arg_iterator placement_arg_begin() const {
2134    return getTrailingObjects<Stmt *>() + placementNewArgsOffset();
2135  }
2136  const_arg_iterator placement_arg_end() const {
2137    return placement_arg_begin() + getNumPlacementArgs();
2138  }
2139
2140  using raw_arg_iterator = Stmt **;
2141
2142  raw_arg_iterator raw_arg_begin() { return getTrailingObjects<Stmt *>(); }
2143  raw_arg_iterator raw_arg_end() {
2144    return raw_arg_begin() + numTrailingObjects(OverloadToken<Stmt *>());
2145  }
2146  const_arg_iterator raw_arg_begin() const {
2147    return getTrailingObjects<Stmt *>();
2148  }
2149  const_arg_iterator raw_arg_end() const {
2150    return raw_arg_begin() + numTrailingObjects(OverloadToken<Stmt *>());
2151  }
2152
2153  SourceLocation getBeginLoc() const { return Range.getBegin(); }
2154  SourceLocation getEndLoc() const { return Range.getEnd(); }
2155
2156  SourceRange getDirectInitRange() const { return DirectInitRange; }
2157  SourceRange getSourceRange() const { return Range; }
2158
2159  static bool classof(const Stmt *T) {
2160    return T->getStmtClass() == CXXNewExprClass;
2161  }
2162
2163  // Iterators
2164  child_range children() { return child_range(raw_arg_begin(), raw_arg_end()); }
2165};
2166
2167/// Represents a \c delete expression for memory deallocation and
2168/// destructor calls, e.g. "delete[] pArray".
2169class CXXDeleteExpr : public Expr {
2170  friend class ASTStmtReader;
2171
2172  /// Points to the operator delete overload that is used. Could be a member.
2173  FunctionDecl *OperatorDelete = nullptr;
2174
2175  /// The pointer expression to be deleted.
2176  Stmt *Argument = nullptr;
2177
2178public:
2179  CXXDeleteExpr(QualType Tybool GlobalDeletebool ArrayForm,
2180                bool ArrayFormAsWrittenbool UsualArrayDeleteWantsSize,
2181                FunctionDecl *OperatorDeleteExpr *ArgSourceLocation Loc)
2182      : Expr(CXXDeleteExprClass, Ty, VK_RValue, OK_Ordinary, falsefalse,
2183             Arg->isInstantiationDependent(),
2184             Arg->containsUnexpandedParameterPack()),
2185        OperatorDelete(OperatorDelete), Argument(Arg) {
2186    CXXDeleteExprBits.GlobalDelete = GlobalDelete;
2187    CXXDeleteExprBits.ArrayForm = ArrayForm;
2188    CXXDeleteExprBits.ArrayFormAsWritten = ArrayFormAsWritten;
2189    CXXDeleteExprBits.UsualArrayDeleteWantsSize = UsualArrayDeleteWantsSize;
2190    CXXDeleteExprBits.Loc = Loc;
2191  }
2192
2193  explicit CXXDeleteExpr(EmptyShell Shell) : Expr(CXXDeleteExprClass, Shell) {}
2194
2195  bool isGlobalDelete() const { return CXXDeleteExprBits.GlobalDelete; }
2196  bool isArrayForm() const { return CXXDeleteExprBits.ArrayForm; }
2197  bool isArrayFormAsWritten() const {
2198    return CXXDeleteExprBits.ArrayFormAsWritten;
2199  }
2200
2201  /// Answers whether the usual array deallocation function for the
2202  /// allocated type expects the size of the allocation as a
2203  /// parameter.  This can be true even if the actual deallocation
2204  /// function that we're using doesn't want a size.
2205  bool doesUsualArrayDeleteWantSize() const {
2206    return CXXDeleteExprBits.UsualArrayDeleteWantsSize;
2207  }
2208
2209  FunctionDecl *getOperatorDelete() const { return OperatorDelete; }
2210
2211  Expr *getArgument() { return cast<Expr>(Argument); }
2212  const Expr *getArgument() const { return cast<Expr>(Argument); }
2213
2214  /// Retrieve the type being destroyed.
2215  ///
2216  /// If the type being destroyed is a dependent type which may or may not
2217  /// be a pointer, return an invalid type.
2218  QualType getDestroyedType() const;
2219
2220  SourceLocation getBeginLoc() const { return CXXDeleteExprBits.Loc; }
2221  SourceLocation getEndLoc() const LLVM_READONLY {
2222    return Argument->getEndLoc();
2223  }
2224
2225  static bool classof(const Stmt *T) {
2226    return T->getStmtClass() == CXXDeleteExprClass;
2227  }
2228
2229  // Iterators
2230  child_range children() { return child_range(&Argument, &Argument + 1); }
2231};
2232
2233/// Stores the type being destroyed by a pseudo-destructor expression.
2234class PseudoDestructorTypeStorage {
2235  /// Either the type source information or the name of the type, if
2236  /// it couldn't be resolved due to type-dependence.
2237  llvm::PointerUnion<TypeSourceInfo *, IdentifierInfo *> Type;
2238
2239  /// The starting source location of the pseudo-destructor type.
2240  SourceLocation Location;
2241
2242public:
2243  PseudoDestructorTypeStorage() = default;
2244
2245  PseudoDestructorTypeStorage(IdentifierInfo *IISourceLocation Loc)
2246      : Type(II), Location(Loc) {}
2247
2248  PseudoDestructorTypeStorage(TypeSourceInfo *Info);
2249
2250  TypeSourceInfo *getTypeSourceInfo() const {
2251    return Type.dyn_cast<TypeSourceInfo *>();
2252  }
2253
2254  IdentifierInfo *getIdentifier() const {
2255    return Type.dyn_cast<IdentifierInfo *>();
2256  }
2257
2258  SourceLocation getLocation() const { return Location; }
2259};
2260
2261/// Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
2262///
2263/// A pseudo-destructor is an expression that looks like a member access to a
2264/// destructor of a scalar type, except that scalar types don't have
2265/// destructors. For example:
2266///
2267/// \code
2268/// typedef int T;
2269/// void f(int *p) {
2270///   p->T::~T();
2271/// }
2272/// \endcode
2273///
2274/// Pseudo-destructors typically occur when instantiating templates such as:
2275///
2276/// \code
2277/// template<typename T>
2278/// void destroy(T* ptr) {
2279///   ptr->T::~T();
2280/// }
2281/// \endcode
2282///
2283/// for scalar types. A pseudo-destructor expression has no run-time semantics
2284/// beyond evaluating the base expression.
2285class CXXPseudoDestructorExpr : public Expr {
2286  friend class ASTStmtReader;
2287
2288  /// The base expression (that is being destroyed).
2289  Stmt *Base = nullptr;
2290
2291  /// Whether the operator was an arrow ('->'); otherwise, it was a
2292  /// period ('.').
2293  bool IsArrow : 1;
2294
2295  /// The location of the '.' or '->' operator.
2296  SourceLocation OperatorLoc;
2297
2298  /// The nested-name-specifier that follows the operator, if present.
2299  NestedNameSpecifierLoc QualifierLoc;
2300
2301  /// The type that precedes the '::' in a qualified pseudo-destructor
2302  /// expression.
2303  TypeSourceInfo *ScopeType = nullptr;
2304
2305  /// The location of the '::' in a qualified pseudo-destructor
2306  /// expression.
2307  SourceLocation ColonColonLoc;
2308
2309  /// The location of the '~'.
2310  SourceLocation TildeLoc;
2311
2312  /// The type being destroyed, or its name if we were unable to
2313  /// resolve the name.
2314  PseudoDestructorTypeStorage DestroyedType;
2315
2316public:
2317  CXXPseudoDestructorExpr(const ASTContext &Context,
2318                          Expr *Basebool isArrowSourceLocation OperatorLoc,
2319                          NestedNameSpecifierLoc QualifierLoc,
2320                          TypeSourceInfo *ScopeType,
2321                          SourceLocation ColonColonLoc,
2322                          SourceLocation TildeLoc,
2323                          PseudoDestructorTypeStorage DestroyedType);
2324
2325  explicit CXXPseudoDestructorExpr(EmptyShell Shell)
2326      : Expr(CXXPseudoDestructorExprClass, Shell), IsArrow(false) {}
2327
2328  Expr *getBase() const { return cast<Expr>(Base); }
2329
2330  /// Determines whether this member expression actually had
2331  /// a C++ nested-name-specifier prior to the name of the member, e.g.,
2332  /// x->Base::foo.
2333  bool hasQualifier() const { return QualifierLoc.hasQualifier(); }
2334
2335  /// Retrieves the nested-name-specifier that qualifies the type name,
2336  /// with source-location information.
2337  NestedNameSpecifierLoc getQualifierLoc() const { return QualifierLoc; }
2338
2339  /// If the member name was qualified, retrieves the
2340  /// nested-name-specifier that precedes the member name. Otherwise, returns
2341  /// null.
2342  NestedNameSpecifier *getQualifier() const {
2343    return QualifierLoc.getNestedNameSpecifier();
2344  }
2345
2346  /// Determine whether this pseudo-destructor expression was written
2347  /// using an '->' (otherwise, it used a '.').
2348  bool isArrow() const { return IsArrow; }
2349
2350  /// Retrieve the location of the '.' or '->' operator.
2351  SourceLocation getOperatorLoc() const { return OperatorLoc; }
2352
2353  /// Retrieve the scope type in a qualified pseudo-destructor
2354  /// expression.
2355  ///
2356  /// Pseudo-destructor expressions can have extra qualification within them
2357  /// that is not part of the nested-name-specifier, e.g., \c p->T::~T().
2358  /// Here, if the object type of the expression is (or may be) a scalar type,
2359  /// \p T may also be a scalar type and, therefore, cannot be part of a
2360  /// nested-name-specifier. It is stored as the "scope type" of the pseudo-
2361  /// destructor expression.
2362  TypeSourceInfo *getScopeTypeInfo() const { return ScopeType; }
2363
2364  /// Retrieve the location of the '::' in a qualified pseudo-destructor
2365  /// expression.
2366  SourceLocation getColonColonLoc() const { return ColonColonLoc; }
2367
2368  /// Retrieve the location of the '~'.
2369  SourceLocation getTildeLoc() const { return TildeLoc; }
2370
2371  /// Retrieve the source location information for the type
2372  /// being destroyed.
2373  ///
2374  /// This type-source information is available for non-dependent
2375  /// pseudo-destructor expressions and some dependent pseudo-destructor
2376  /// expressions. Returns null if we only have the identifier for a
2377  /// dependent pseudo-destructor expression.
2378  TypeSourceInfo *getDestroyedTypeInfo() const {
2379    return DestroyedType.getTypeSourceInfo();
2380  }
2381
2382  /// In a dependent pseudo-destructor expression for which we do not
2383  /// have full type information on the destroyed type, provides the name
2384  /// of the destroyed type.
2385  IdentifierInfo *getDestroyedTypeIdentifier() const {
2386    return DestroyedType.getIdentifier();
2387  }
2388
2389  /// Retrieve the type being destroyed.
2390  QualType getDestroyedType() const;
2391
2392  /// Retrieve the starting location of the type being destroyed.
2393  SourceLocation getDestroyedTypeLoc() const {
2394    return DestroyedType.getLocation();
2395  }
2396
2397  /// Set the name of destroyed type for a dependent pseudo-destructor
2398  /// expression.
2399  void setDestroyedType(IdentifierInfo *IISourceLocation Loc) {
2400    DestroyedType = PseudoDestructorTypeStorage(II, Loc);
2401  }
2402
2403  /// Set the destroyed type.
2404  void setDestroyedType(TypeSourceInfo *Info) {
2405    DestroyedType = PseudoDestructorTypeStorage(Info);
2406  }
2407
2408  SourceLocation getBeginLoc() const LLVM_READONLY {
2409    return Base->getBeginLoc();
2410  }
2411  SourceLocation getEndLoc() const LLVM_READONLY;
2412
2413  static bool classof(const Stmt *T) {
2414    return T->getStmtClass() == CXXPseudoDestructorExprClass;
2415  }
2416
2417  // Iterators
2418  child_range children() { return child_range(&Base, &Base + 1); }
2419};
2420
2421/// A type trait used in the implementation of various C++11 and
2422/// Library TR1 trait templates.
2423///
2424/// \code
2425///   __is_pod(int) == true
2426///   __is_enum(std::string) == false
2427///   __is_trivially_constructible(vector<int>, int*, int*)
2428/// \endcode
2429class TypeTraitExpr final
2430    : public Expr,
2431      private llvm::TrailingObjects<TypeTraitExpr, TypeSourceInfo *> {
2432  /// The location of the type trait keyword.
2433  SourceLocation Loc;
2434
2435  ///  The location of the closing parenthesis.
2436  SourceLocation RParenLoc;
2437
2438  // Note: The TypeSourceInfos for the arguments are allocated after the
2439  // TypeTraitExpr.
2440
2441  TypeTraitExpr(QualType TSourceLocation LocTypeTrait Kind,
2442                ArrayRef<TypeSourceInfo *> Args,
2443                SourceLocation RParenLoc,
2444                bool Value);
2445
2446  TypeTraitExpr(EmptyShell Empty) : Expr(TypeTraitExprClass, Empty) {}
2447
2448  size_t numTrailingObjects(OverloadToken<TypeSourceInfo *>) const {
2449    return getNumArgs();
2450  }
2451
2452public:
2453  friend class ASTStmtReader;
2454  friend class ASTStmtWriter;
2455  friend TrailingObjects;
2456
2457  /// Create a new type trait expression.
2458  static TypeTraitExpr *Create(const ASTContext &CQualType T,
2459                               SourceLocation LocTypeTrait Kind,
2460                               ArrayRef<TypeSourceInfo *> Args,
2461                               SourceLocation RParenLoc,
2462                               bool Value);
2463
2464  static TypeTraitExpr *CreateDeserialized(const ASTContext &C,
2465                                           unsigned NumArgs);
2466
2467  /// Determine which type trait this expression uses.
2468  TypeTrait getTrait() const {
2469    return static_cast<TypeTrait>(TypeTraitExprBits.Kind);
2470  }
2471
2472  bool getValue() const {
2473    assert(!isValueDependent());
2474    return TypeTraitExprBits.Value;
2475  }
2476
2477  /// Determine the number of arguments to this type trait.
2478  unsigned getNumArgs() const { return TypeTraitExprBits.NumArgs; }
2479
2480  /// Retrieve the Ith argument.
2481  TypeSourceInfo *getArg(unsigned Iconst {
2482     (0) . __assert_fail ("I < getNumArgs() && \"Argument out-of-range\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/ExprCXX.h", 2482, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(I < getNumArgs() && "Argument out-of-range");
2483    return getArgs()[I];
2484  }
2485
2486  /// Retrieve the argument types.
2487  ArrayRef<TypeSourceInfo *> getArgs() const {
2488    return llvm::makeArrayRef(getTrailingObjects<TypeSourceInfo *>(),
2489                              getNumArgs());
2490  }
2491
2492  SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; }
2493  SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; }
2494
2495  static bool classof(const Stmt *T) {
2496    return T->getStmtClass() == TypeTraitExprClass;
2497  }
2498
2499  // Iterators
2500  child_range children() {
2501    return child_range(child_iterator(), child_iterator());
2502  }
2503};
2504
2505/// An Embarcadero array type trait, as used in the implementation of
2506/// __array_rank and __array_extent.
2507///
2508/// Example:
2509/// \code
2510///   __array_rank(int[10][20]) == 2
2511///   __array_extent(int, 1)    == 20
2512/// \endcode
2513class ArrayTypeTraitExpr : public Expr {
2514  /// The trait. An ArrayTypeTrait enum in MSVC compat unsigned.
2515  unsigned ATT : 2;
2516
2517  /// The value of the type trait. Unspecified if dependent.
2518  uint64_t Value = 0;
2519
2520  /// The array dimension being queried, or -1 if not used.
2521  Expr *Dimension;
2522
2523  /// The location of the type trait keyword.
2524  SourceLocation Loc;
2525
2526  /// The location of the closing paren.
2527  SourceLocation RParen;
2528
2529  /// The type being queried.
2530  TypeSourceInfo *QueriedType = nullptr;
2531
2532public:
2533  friend class ASTStmtReader;
2534
2535  ArrayTypeTraitExpr(SourceLocation locArrayTypeTrait att,
2536                     TypeSourceInfo *querieduint64_t value,
2537                     Expr *dimensionSourceLocation rparenQualType ty)
2538      : Expr(ArrayTypeTraitExprClass, ty, VK_RValue, OK_Ordinary,
2539             false, queried->getType()->isDependentType(),
2540             (queried->getType()->isInstantiationDependentType() ||
2541              (dimension && dimension->isInstantiationDependent())),
2542             queried->getType()->containsUnexpandedParameterPack()),
2543        ATT(att), Value(value), Dimension(dimension),
2544        Loc(loc), RParen(rparen), QueriedType(queried) {}
2545
2546  explicit ArrayTypeTraitExpr(EmptyShell Empty)
2547      : Expr(ArrayTypeTraitExprClass, Empty), ATT(0) {}
2548
2549  SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; }
2550  SourceLocation getEndLoc() const LLVM_READONLY { return RParen; }
2551
2552  ArrayTypeTrait getTrait() const { return static_cast<ArrayTypeTrait>(ATT); }
2553
2554  QualType getQueriedType() const { return QueriedType->getType(); }
2555
2556  TypeSourceInfo *getQueriedTypeSourceInfo() const { return QueriedType; }
2557
2558  uint64_t getValue() const { assert(!isTypeDependent())return Value; }
2559
2560  Expr *getDimensionExpression() const { return Dimension; }
2561
2562  static bool classof(const Stmt *T) {
2563    return T->getStmtClass() == ArrayTypeTraitExprClass;
2564  }
2565
2566  // Iterators
2567  child_range children() {
2568    return child_range(child_iterator(), child_iterator());
2569  }
2570};
2571
2572/// An expression trait intrinsic.
2573///
2574/// Example:
2575/// \code
2576///   __is_lvalue_expr(std::cout) == true
2577///   __is_lvalue_expr(1) == false
2578/// \endcode
2579class ExpressionTraitExpr : public Expr {
2580  /// The trait. A ExpressionTrait enum in MSVC compatible unsigned.
2581  unsigned ET : 31;
2582
2583  /// The value of the type trait. Unspecified if dependent.
2584  unsigned Value : 1;
2585
2586  /// The location of the type trait keyword.
2587  SourceLocation Loc;
2588
2589  /// The location of the closing paren.
2590  SourceLocation RParen;
2591
2592  /// The expression being queried.
2593  ExprQueriedExpression = nullptr;
2594
2595public:
2596  friend class ASTStmtReader;
2597
2598  ExpressionTraitExpr(SourceLocation locExpressionTrait et,
2599                     Expr *queriedbool value,
2600                     SourceLocation rparenQualType resultType)
2601      : Expr(ExpressionTraitExprClass, resultType, VK_RValue, OK_Ordinary,
2602             false// Not type-dependent
2603             // Value-dependent if the argument is type-dependent.
2604             queried->isTypeDependent(),
2605             queried->isInstantiationDependent(),
2606             queried->containsUnexpandedParameterPack()),
2607        ET(et), Value(value), Loc(loc), RParen(rparen),
2608        QueriedExpression(queried) {}
2609
2610  explicit ExpressionTraitExpr(EmptyShell Empty)
2611      : Expr(ExpressionTraitExprClass, Empty), ET(0), Value(false) {}
2612
2613  SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; }
2614  SourceLocation getEndLoc() const LLVM_READONLY { return RParen; }
2615
2616  ExpressionTrait getTrait() const { return static_cast<ExpressionTrait>(ET); }
2617
2618  Expr *getQueriedExpression() const { return QueriedExpression; }
2619
2620  bool getValue() const { return Value; }
2621
2622  static bool classof(const Stmt *T) {
2623    return T->getStmtClass() == ExpressionTraitExprClass;
2624  }
2625
2626  // Iterators
2627  child_range children() {
2628    return child_range(child_iterator(), child_iterator());
2629  }
2630};
2631
2632/// A reference to an overloaded function set, either an
2633/// \c UnresolvedLookupExpr or an \c UnresolvedMemberExpr.
2634class OverloadExpr : public Expr {
2635  friend class ASTStmtReader;
2636  friend class ASTStmtWriter;
2637
2638  /// The common name of these declarations.
2639  DeclarationNameInfo NameInfo;
2640
2641  /// The nested-name-specifier that qualifies the name, if any.
2642  NestedNameSpecifierLoc QualifierLoc;
2643
2644protected:
2645  OverloadExpr(StmtClass SCconst ASTContext &Context,
2646               NestedNameSpecifierLoc QualifierLoc,
2647               SourceLocation TemplateKWLoc,
2648               const DeclarationNameInfo &NameInfo,
2649               const TemplateArgumentListInfo *TemplateArgs,
2650               UnresolvedSetIterator BeginUnresolvedSetIterator End,
2651               bool KnownDependentbool KnownInstantiationDependent,
2652               bool KnownContainsUnexpandedParameterPack);
2653
2654  OverloadExpr(StmtClass SCEmptyShell Emptyunsigned NumResults,
2655               bool HasTemplateKWAndArgsInfo);
2656
2657  /// Return the results. Defined after UnresolvedMemberExpr.
2658  inline DeclAccessPair *getTrailingResults();
2659  const DeclAccessPair *getTrailingResults() const {
2660    return const_cast<OverloadExpr *>(this)->getTrailingResults();
2661  }
2662
2663  /// Return the optional template keyword and arguments info.
2664  /// Defined after UnresolvedMemberExpr.
2665  inline ASTTemplateKWAndArgsInfo *getTrailingASTTemplateKWAndArgsInfo();
2666  const ASTTemplateKWAndArgsInfo *getTrailingASTTemplateKWAndArgsInfo() const {
2667    return const_cast<OverloadExpr *>(this)
2668        ->getTrailingASTTemplateKWAndArgsInfo();
2669  }
2670
2671  /// Return the optional template arguments. Defined after
2672  /// UnresolvedMemberExpr.
2673  inline TemplateArgumentLoc *getTrailingTemplateArgumentLoc();
2674  const TemplateArgumentLoc *getTrailingTemplateArgumentLoc() const {
2675    return const_cast<OverloadExpr *>(this)->getTrailingTemplateArgumentLoc();
2676  }
2677
2678  bool hasTemplateKWAndArgsInfo() const {
2679    return OverloadExprBits.HasTemplateKWAndArgsInfo;
2680  }
2681
2682public:
2683  struct FindResult {
2684    OverloadExpr *Expression;
2685    bool IsAddressOfOperand;
2686    bool HasFormOfMemberPointer;
2687  };
2688
2689  /// Finds the overloaded expression in the given expression \p E of
2690  /// OverloadTy.
2691  ///
2692  /// \return the expression (which must be there) and true if it has
2693  /// the particular form of a member pointer expression
2694  static FindResult find(Expr *E) {
2695    getType()->isSpecificBuiltinType(BuiltinType..Overload)", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/ExprCXX.h", 2695, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(E->getType()->isSpecificBuiltinType(BuiltinType::Overload));
2696
2697    FindResult Result;
2698
2699    E = E->IgnoreParens();
2700    if (isa<UnaryOperator>(E)) {
2701      (E)->getOpcode() == UO_AddrOf", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/ExprCXX.h", 2701, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(cast<UnaryOperator>(E)->getOpcode() == UO_AddrOf);
2702      E = cast<UnaryOperator>(E)->getSubExpr();
2703      auto *Ovl = cast<OverloadExpr>(E->IgnoreParens());
2704
2705      Result.HasFormOfMemberPointer = (E == Ovl && Ovl->getQualifier());
2706      Result.IsAddressOfOperand = true;
2707      Result.Expression = Ovl;
2708    } else {
2709      Result.HasFormOfMemberPointer = false;
2710      Result.IsAddressOfOperand = false;
2711      Result.Expression = cast<OverloadExpr>(E);
2712    }
2713
2714    return Result;
2715  }
2716
2717  /// Gets the naming class of this lookup, if any.
2718  /// Defined after UnresolvedMemberExpr.
2719  inline CXXRecordDecl *getNamingClass();
2720  const CXXRecordDecl *getNamingClass() const {
2721    return const_cast<OverloadExpr *>(this)->getNamingClass();
2722  }
2723
2724  using decls_iterator = UnresolvedSetImpl::iterator;
2725
2726  decls_iterator decls_begin() const {
2727    return UnresolvedSetIterator(getTrailingResults());
2728  }
2729  decls_iterator decls_end() const {
2730    return UnresolvedSetIterator(getTrailingResults() + getNumDecls());
2731  }
2732  llvm::iterator_range<decls_iterator> decls() const {
2733    return llvm::make_range(decls_begin(), decls_end());
2734  }
2735
2736  /// Gets the number of declarations in the unresolved set.
2737  unsigned getNumDecls() const { return OverloadExprBits.NumResults; }
2738
2739  /// Gets the full name info.
2740  const DeclarationNameInfo &getNameInfo() const { return NameInfo; }
2741
2742  /// Gets the name looked up.
2743  DeclarationName getName() const { return NameInfo.getName(); }
2744
2745  /// Gets the location of the name.
2746  SourceLocation getNameLoc() const { return NameInfo.getLoc(); }
2747
2748  /// Fetches the nested-name qualifier, if one was given.
2749  NestedNameSpecifier *getQualifier() const {
2750    return QualifierLoc.getNestedNameSpecifier();
2751  }
2752
2753  /// Fetches the nested-name qualifier with source-location
2754  /// information, if one was given.
2755  NestedNameSpecifierLoc getQualifierLoc() const { return QualifierLoc; }
2756
2757  /// Retrieve the location of the template keyword preceding
2758  /// this name, if any.
2759  SourceLocation getTemplateKeywordLoc() const {
2760    if (!hasTemplateKWAndArgsInfo())
2761      return SourceLocation();
2762    return getTrailingASTTemplateKWAndArgsInfo()->TemplateKWLoc;
2763  }
2764
2765  /// Retrieve the location of the left angle bracket starting the
2766  /// explicit template argument list following the name, if any.
2767  SourceLocation getLAngleLoc() const {
2768    if (!hasTemplateKWAndArgsInfo())
2769      return SourceLocation();
2770    return getTrailingASTTemplateKWAndArgsInfo()->LAngleLoc;
2771  }
2772
2773  /// Retrieve the location of the right angle bracket ending the
2774  /// explicit template argument list following the name, if any.
2775  SourceLocation getRAngleLoc() const {
2776    if (!hasTemplateKWAndArgsInfo())
2777      return SourceLocation();
2778    return getTrailingASTTemplateKWAndArgsInfo()->RAngleLoc;
2779  }
2780
2781  /// Determines whether the name was preceded by the template keyword.
2782  bool hasTemplateKeyword() const { return getTemplateKeywordLoc().isValid(); }
2783
2784  /// Determines whether this expression had explicit template arguments.
2785  bool hasExplicitTemplateArgs() const { return getLAngleLoc().isValid(); }
2786
2787  TemplateArgumentLoc const *getTemplateArgs() const {
2788    if (!hasExplicitTemplateArgs())
2789      return nullptr;
2790    return const_cast<OverloadExpr *>(this)->getTrailingTemplateArgumentLoc();
2791  }
2792
2793  unsigned getNumTemplateArgs() const {
2794    if (!hasExplicitTemplateArgs())
2795      return 0;
2796
2797    return getTrailingASTTemplateKWAndArgsInfo()->NumTemplateArgs;
2798  }
2799
2800  ArrayRef<TemplateArgumentLoctemplate_arguments() const {
2801    return {getTemplateArgs(), getNumTemplateArgs()};
2802  }
2803
2804  /// Copies the template arguments into the given structure.
2805  void copyTemplateArgumentsInto(TemplateArgumentListInfo &Listconst {
2806    if (hasExplicitTemplateArgs())
2807      getTrailingASTTemplateKWAndArgsInfo()->copyInto(getTemplateArgs(), List);
2808  }
2809
2810  static bool classof(const Stmt *T) {
2811    return T->getStmtClass() == UnresolvedLookupExprClass ||
2812           T->getStmtClass() == UnresolvedMemberExprClass;
2813  }
2814};
2815
2816/// A reference to a name which we were able to look up during
2817/// parsing but could not resolve to a specific declaration.
2818///
2819/// This arises in several ways:
2820///   * we might be waiting for argument-dependent lookup;
2821///   * the name might resolve to an overloaded function;
2822/// and eventually:
2823///   * the lookup might have included a function template.
2824///
2825/// These never include UnresolvedUsingValueDecls, which are always class
2826/// members and therefore appear only in UnresolvedMemberLookupExprs.
2827class UnresolvedLookupExpr final
2828    : public OverloadExpr,
2829      private llvm::TrailingObjects<UnresolvedLookupExpr, DeclAccessPair,
2830                                    ASTTemplateKWAndArgsInfo,
2831                                    TemplateArgumentLoc> {
2832  friend class ASTStmtReader;
2833  friend class OverloadExpr;
2834  friend TrailingObjects;
2835
2836  /// The naming class (C++ [class.access.base]p5) of the lookup, if
2837  /// any.  This can generally be recalculated from the context chain,
2838  /// but that can be fairly expensive for unqualified lookups.
2839  CXXRecordDecl *NamingClass;
2840
2841  // UnresolvedLookupExpr is followed by several trailing objects.
2842  // They are in order:
2843  //
2844  // * An array of getNumResults() DeclAccessPair for the results. These are
2845  //   undesugared, which is to say, they may include UsingShadowDecls.
2846  //   Access is relative to the naming class.
2847  //
2848  // * An optional ASTTemplateKWAndArgsInfo for the explicitly specified
2849  //   template keyword and arguments. Present if and only if
2850  //   hasTemplateKWAndArgsInfo().
2851  //
2852  // * An array of getNumTemplateArgs() TemplateArgumentLoc containing
2853  //   location information for the explicitly specified template arguments.
2854
2855  UnresolvedLookupExpr(const ASTContext &ContextCXXRecordDecl *NamingClass,
2856                       NestedNameSpecifierLoc QualifierLoc,
2857                       SourceLocation TemplateKWLoc,
2858                       const DeclarationNameInfo &NameInfobool RequiresADL,
2859                       bool Overloaded,
2860                       const TemplateArgumentListInfo *TemplateArgs,
2861                       UnresolvedSetIterator BeginUnresolvedSetIterator End);
2862
2863  UnresolvedLookupExpr(EmptyShell Emptyunsigned NumResults,
2864                       bool HasTemplateKWAndArgsInfo);
2865
2866  unsigned numTrailingObjects(OverloadToken<DeclAccessPair>) const {
2867    return getNumDecls();
2868  }
2869
2870  unsigned numTrailingObjects(OverloadToken<ASTTemplateKWAndArgsInfo>) const {
2871    return hasTemplateKWAndArgsInfo();
2872  }
2873
2874public:
2875  static UnresolvedLookupExpr *
2876  Create(const ASTContext &ContextCXXRecordDecl *NamingClass,
2877         NestedNameSpecifierLoc QualifierLoc,
2878         const DeclarationNameInfo &NameInfobool RequiresADLbool Overloaded,
2879         UnresolvedSetIterator BeginUnresolvedSetIterator End);
2880
2881  static UnresolvedLookupExpr *
2882  Create(const ASTContext &ContextCXXRecordDecl *NamingClass,
2883         NestedNameSpecifierLoc QualifierLocSourceLocation TemplateKWLoc,
2884         const DeclarationNameInfo &NameInfobool RequiresADL,
2885         const TemplateArgumentListInfo *ArgsUnresolvedSetIterator Begin,
2886         UnresolvedSetIterator End);
2887
2888  static UnresolvedLookupExpr *CreateEmpty(const ASTContext &Context,
2889                                           unsigned NumResults,
2890                                           bool HasTemplateKWAndArgsInfo,
2891                                           unsigned NumTemplateArgs);
2892
2893  /// True if this declaration should be extended by
2894  /// argument-dependent lookup.
2895  bool requiresADL() const { return UnresolvedLookupExprBits.RequiresADL; }
2896
2897  /// True if this lookup is overloaded.
2898  bool isOverloaded() const { return UnresolvedLookupExprBits.Overloaded; }
2899
2900  /// Gets the 'naming class' (in the sense of C++0x
2901  /// [class.access.base]p5) of the lookup.  This is the scope
2902  /// that was looked in to find these results.
2903  CXXRecordDecl *getNamingClass() { return NamingClass; }
2904  const CXXRecordDecl *getNamingClass() const { return NamingClass; }
2905
2906  SourceLocation getBeginLoc() const LLVM_READONLY {
2907    if (NestedNameSpecifierLoc l = getQualifierLoc())
2908      return l.getBeginLoc();
2909    return getNameInfo().getBeginLoc();
2910  }
2911
2912  SourceLocation getEndLoc() const LLVM_READONLY {
2913    if (hasExplicitTemplateArgs())
2914      return getRAngleLoc();
2915    return getNameInfo().getEndLoc();
2916  }
2917
2918  child_range children() {
2919    return child_range(child_iterator(), child_iterator());
2920  }
2921
2922  static bool classof(const Stmt *T) {
2923    return T->getStmtClass() == UnresolvedLookupExprClass;
2924  }
2925};
2926
2927/// A qualified reference to a name whose declaration cannot
2928/// yet be resolved.
2929///
2930/// DependentScopeDeclRefExpr is similar to DeclRefExpr in that
2931/// it expresses a reference to a declaration such as
2932/// X<T>::value. The difference, however, is that an
2933/// DependentScopeDeclRefExpr node is used only within C++ templates when
2934/// the qualification (e.g., X<T>::) refers to a dependent type. In
2935/// this case, X<T>::value cannot resolve to a declaration because the
2936/// declaration will differ from one instantiation of X<T> to the
2937/// next. Therefore, DependentScopeDeclRefExpr keeps track of the
2938/// qualifier (X<T>::) and the name of the entity being referenced
2939/// ("value"). Such expressions will instantiate to a DeclRefExpr once the
2940/// declaration can be found.
2941class DependentScopeDeclRefExpr final
2942    : public Expr,
2943      private llvm::TrailingObjects<DependentScopeDeclRefExpr,
2944                                    ASTTemplateKWAndArgsInfo,
2945                                    TemplateArgumentLoc> {
2946  friend class ASTStmtReader;
2947  friend class ASTStmtWriter;
2948  friend TrailingObjects;
2949
2950  /// The nested-name-specifier that qualifies this unresolved
2951  /// declaration name.
2952  NestedNameSpecifierLoc QualifierLoc;
2953
2954  /// The name of the entity we will be referencing.
2955  DeclarationNameInfo NameInfo;
2956
2957  DependentScopeDeclRefExpr(QualType TyNestedNameSpecifierLoc QualifierLoc,
2958                            SourceLocation TemplateKWLoc,
2959                            const DeclarationNameInfo &NameInfo,
2960                            const TemplateArgumentListInfo *Args);
2961
2962  size_t numTrailingObjects(OverloadToken<ASTTemplateKWAndArgsInfo>) const {
2963    return hasTemplateKWAndArgsInfo();
2964  }
2965
2966  bool hasTemplateKWAndArgsInfo() const {
2967    return DependentScopeDeclRefExprBits.HasTemplateKWAndArgsInfo;
2968  }
2969
2970public:
2971  static DependentScopeDeclRefExpr *
2972  Create(const ASTContext &ContextNestedNameSpecifierLoc QualifierLoc,
2973         SourceLocation TemplateKWLocconst DeclarationNameInfo &NameInfo,
2974         const TemplateArgumentListInfo *TemplateArgs);
2975
2976  static DependentScopeDeclRefExpr *CreateEmpty(const ASTContext &Context,
2977                                                bool HasTemplateKWAndArgsInfo,
2978                                                unsigned NumTemplateArgs);
2979
2980  /// Retrieve the name that this expression refers to.
2981  const DeclarationNameInfo &getNameInfo() const { return NameInfo; }
2982
2983  /// Retrieve the name that this expression refers to.
2984  DeclarationName getDeclName() const { return NameInfo.getName(); }
2985
2986  /// Retrieve the location of the name within the expression.
2987  ///
2988  /// For example, in "X<T>::value" this is the location of "value".
2989  SourceLocation getLocation() const { return NameInfo.getLoc(); }
2990
2991  /// Retrieve the nested-name-specifier that qualifies the
2992  /// name, with source location information.
2993  NestedNameSpecifierLoc getQualifierLoc() const { return QualifierLoc; }
2994
2995  /// Retrieve the nested-name-specifier that qualifies this
2996  /// declaration.
2997  NestedNameSpecifier *getQualifier() const {
2998    return QualifierLoc.getNestedNameSpecifier();
2999  }
3000
3001  /// Retrieve the location of the template keyword preceding
3002  /// this name, if any.
3003  SourceLocation getTemplateKeywordLoc() const {
3004    if (!hasTemplateKWAndArgsInfo())
3005      return SourceLocation();
3006    return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->TemplateKWLoc;
3007  }
3008
3009  /// Retrieve the location of the left angle bracket starting the
3010  /// explicit template argument list following the name, if any.
3011  SourceLocation getLAngleLoc() const {
3012    if (!hasTemplateKWAndArgsInfo())
3013      return SourceLocation();
3014    return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->LAngleLoc;
3015  }
3016
3017  /// Retrieve the location of the right angle bracket ending the
3018  /// explicit template argument list following the name, if any.
3019  SourceLocation getRAngleLoc() const {
3020    if (!hasTemplateKWAndArgsInfo())
3021      return SourceLocation();
3022    return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->RAngleLoc;
3023  }
3024
3025  /// Determines whether the name was preceded by the template keyword.
3026  bool hasTemplateKeyword() const { return getTemplateKeywordLoc().isValid(); }
3027
3028  /// Determines whether this lookup had explicit template arguments.
3029  bool hasExplicitTemplateArgs() const { return getLAngleLoc().isValid(); }
3030
3031  /// Copies the template arguments (if present) into the given
3032  /// structure.
3033  void copyTemplateArgumentsInto(TemplateArgumentListInfo &Listconst {
3034    if (hasExplicitTemplateArgs())
3035      getTrailingObjects<ASTTemplateKWAndArgsInfo>()->copyInto(
3036          getTrailingObjects<TemplateArgumentLoc>(), List);
3037  }
3038
3039  TemplateArgumentLoc const *getTemplateArgs() const {
3040    if (!hasExplicitTemplateArgs())
3041      return nullptr;
3042
3043    return getTrailingObjects<TemplateArgumentLoc>();
3044  }
3045
3046  unsigned getNumTemplateArgs() const {
3047    if (!hasExplicitTemplateArgs())
3048      return 0;
3049
3050    return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->NumTemplateArgs;
3051  }
3052
3053  ArrayRef<TemplateArgumentLoctemplate_arguments() const {
3054    return {getTemplateArgs(), getNumTemplateArgs()};
3055  }
3056
3057  /// Note: getBeginLoc() is the start of the whole DependentScopeDeclRefExpr,
3058  /// and differs from getLocation().getStart().
3059  SourceLocation getBeginLoc() const LLVM_READONLY {
3060    return QualifierLoc.getBeginLoc();
3061  }
3062
3063  SourceLocation getEndLoc() const LLVM_READONLY {
3064    if (hasExplicitTemplateArgs())
3065      return getRAngleLoc();
3066    return getLocation();
3067  }
3068
3069  static bool classof(const Stmt *T) {
3070    return T->getStmtClass() == DependentScopeDeclRefExprClass;
3071  }
3072
3073  child_range children() {
3074    return child_range(child_iterator(), child_iterator());
3075  }
3076};
3077
3078/// Represents an expression -- generally a full-expression -- that
3079/// introduces cleanups to be run at the end of the sub-expression's
3080/// evaluation.  The most common source of expression-introduced
3081/// cleanups is temporary objects in C++, but several other kinds of
3082/// expressions can create cleanups, including basically every
3083/// call in ARC that returns an Objective-C pointer.
3084///
3085/// This expression also tracks whether the sub-expression contains a
3086/// potentially-evaluated block literal.  The lifetime of a block
3087/// literal is the extent of the enclosing scope.
3088class ExprWithCleanups final
3089    : public FullExpr,
3090      private llvm::TrailingObjects<ExprWithCleanups, BlockDecl *> {
3091public:
3092  /// The type of objects that are kept in the cleanup.
3093  /// It's useful to remember the set of blocks;  we could also
3094  /// remember the set of temporaries, but there's currently
3095  /// no need.
3096  using CleanupObject = BlockDecl *;
3097
3098private:
3099  friend class ASTStmtReader;
3100  friend TrailingObjects;
3101
3102  ExprWithCleanups(EmptyShellunsigned NumObjects);
3103  ExprWithCleanups(Expr *SubExprbool CleanupsHaveSideEffects,
3104                   ArrayRef<CleanupObjectObjects);
3105
3106public:
3107  static ExprWithCleanups *Create(const ASTContext &CEmptyShell empty,
3108                                  unsigned numObjects);
3109
3110  static ExprWithCleanups *Create(const ASTContext &CExpr *subexpr,
3111                                  bool CleanupsHaveSideEffects,
3112                                  ArrayRef<CleanupObjectobjects);
3113
3114  ArrayRef<CleanupObjectgetObjects() const {
3115    return llvm::makeArrayRef(getTrailingObjects<CleanupObject>(),
3116                              getNumObjects());
3117  }
3118
3119  unsigned getNumObjects() const { return ExprWithCleanupsBits.NumObjects; }
3120
3121  CleanupObject getObject(unsigned iconst {
3122     (0) . __assert_fail ("i < getNumObjects() && \"Index out of range\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/ExprCXX.h", 3122, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(i < getNumObjects() && "Index out of range");
3123    return getObjects()[i];
3124  }
3125
3126  bool cleanupsHaveSideEffects() const {
3127    return ExprWithCleanupsBits.CleanupsHaveSideEffects;
3128  }
3129
3130  SourceLocation getBeginLoc() const LLVM_READONLY {
3131    return SubExpr->getBeginLoc();
3132  }
3133
3134  SourceLocation getEndLoc() const LLVM_READONLY {
3135    return SubExpr->getEndLoc();
3136  }
3137
3138  // Implement isa/cast/dyncast/etc.
3139  static bool classof(const Stmt *T) {
3140    return T->getStmtClass() == ExprWithCleanupsClass;
3141  }
3142
3143  // Iterators
3144  child_range children() { return child_range(&SubExpr, &SubExpr + 1); }
3145};
3146
3147/// Describes an explicit type conversion that uses functional
3148/// notion but could not be resolved because one or more arguments are
3149/// type-dependent.
3150///
3151/// The explicit type conversions expressed by
3152/// CXXUnresolvedConstructExpr have the form <tt>T(a1, a2, ..., aN)</tt>,
3153/// where \c T is some type and \c a1, \c a2, ..., \c aN are values, and
3154/// either \c T is a dependent type or one or more of the <tt>a</tt>'s is
3155/// type-dependent. For example, this would occur in a template such
3156/// as:
3157///
3158/// \code
3159///   template<typename T, typename A1>
3160///   inline T make_a(const A1& a1) {
3161///     return T(a1);
3162///   }
3163/// \endcode
3164///
3165/// When the returned expression is instantiated, it may resolve to a
3166/// constructor call, conversion function call, or some kind of type
3167/// conversion.
3168class CXXUnresolvedConstructExpr final
3169    : public Expr,
3170      private llvm::TrailingObjects<CXXUnresolvedConstructExpr, Expr *> {
3171  friend class ASTStmtReader;
3172  friend TrailingObjects;
3173
3174  /// The type being constructed.
3175  TypeSourceInfo *TSI;
3176
3177  /// The location of the left parentheses ('(').
3178  SourceLocation LParenLoc;
3179
3180  /// The location of the right parentheses (')').
3181  SourceLocation RParenLoc;
3182
3183  CXXUnresolvedConstructExpr(TypeSourceInfo *TSISourceLocation LParenLoc,
3184                             ArrayRef<Expr *> ArgsSourceLocation RParenLoc);
3185
3186  CXXUnresolvedConstructExpr(EmptyShell Emptyunsigned NumArgs)
3187      : Expr(CXXUnresolvedConstructExprClass, Empty) {
3188    CXXUnresolvedConstructExprBits.NumArgs = NumArgs;
3189  }
3190
3191public:
3192  static CXXUnresolvedConstructExpr *Create(const ASTContext &Context,
3193                                            TypeSourceInfo *Type,
3194                                            SourceLocation LParenLoc,
3195                                            ArrayRef<Expr *> Args,
3196                                            SourceLocation RParenLoc);
3197
3198  static CXXUnresolvedConstructExpr *CreateEmpty(const ASTContext &Context,
3199                                                 unsigned NumArgs);
3200
3201  /// Retrieve the type that is being constructed, as specified
3202  /// in the source code.
3203  QualType getTypeAsWritten() const { return TSI->getType(); }
3204
3205  /// Retrieve the type source information for the type being
3206  /// constructed.
3207  TypeSourceInfo *getTypeSourceInfo() const { return TSI; }
3208
3209  /// Retrieve the location of the left parentheses ('(') that
3210  /// precedes the argument list.
3211  SourceLocation getLParenLoc() const { return LParenLoc; }
3212  void setLParenLoc(SourceLocation L) { LParenLoc = L; }
3213
3214  /// Retrieve the location of the right parentheses (')') that
3215  /// follows the argument list.
3216  SourceLocation getRParenLoc() const { return RParenLoc; }
3217  void setRParenLoc(SourceLocation L) { RParenLoc = L; }
3218
3219  /// Determine whether this expression models list-initialization.
3220  /// If so, there will be exactly one subexpression, which will be
3221  /// an InitListExpr.
3222  bool isListInitialization() const { return LParenLoc.isInvalid(); }
3223
3224  /// Retrieve the number of arguments.
3225  unsigned arg_size() const { return CXXUnresolvedConstructExprBits.NumArgs; }
3226
3227  using arg_iterator = Expr **;
3228  using arg_range = llvm::iterator_range<arg_iterator>;
3229
3230  arg_iterator arg_begin() { return getTrailingObjects<Expr *>(); }
3231  arg_iterator arg_end() { return arg_begin() + arg_size(); }
3232  arg_range arguments() { return arg_range(arg_begin(), arg_end()); }
3233
3234  using const_arg_iterator = const Exprconst *;
3235  using const_arg_range = llvm::iterator_range<const_arg_iterator>;
3236
3237  const_arg_iterator arg_begin() const { return getTrailingObjects<Expr *>(); }
3238  const_arg_iterator arg_end() const { return arg_begin() + arg_size(); }
3239  const_arg_range arguments() const {
3240    return const_arg_range(arg_begin(), arg_end());
3241  }
3242
3243  Expr *getArg(unsigned I) {
3244     (0) . __assert_fail ("I < arg_size() && \"Argument index out-of-range\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/ExprCXX.h", 3244, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(I < arg_size() && "Argument index out-of-range");
3245    return arg_begin()[I];
3246  }
3247
3248  const Expr *getArg(unsigned Iconst {
3249     (0) . __assert_fail ("I < arg_size() && \"Argument index out-of-range\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/ExprCXX.h", 3249, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(I < arg_size() && "Argument index out-of-range");
3250    return arg_begin()[I];
3251  }
3252
3253  void setArg(unsigned IExpr *E) {
3254     (0) . __assert_fail ("I < arg_size() && \"Argument index out-of-range\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/ExprCXX.h", 3254, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(I < arg_size() && "Argument index out-of-range");
3255    arg_begin()[I] = E;
3256  }
3257
3258  SourceLocation getBeginLoc() const LLVM_READONLY;
3259  SourceLocation getEndLoc() const LLVM_READONLY {
3260    if (!RParenLoc.isValid() && arg_size() > 0)
3261      return getArg(arg_size() - 1)->getEndLoc();
3262    return RParenLoc;
3263  }
3264
3265  static bool classof(const Stmt *T) {
3266    return T->getStmtClass() == CXXUnresolvedConstructExprClass;
3267  }
3268
3269  // Iterators
3270  child_range children() {
3271    auto **begin = reinterpret_cast<Stmt **>(arg_begin());
3272    return child_range(begin, begin + arg_size());
3273  }
3274};
3275
3276/// Represents a C++ member access expression where the actual
3277/// member referenced could not be resolved because the base
3278/// expression or the member name was dependent.
3279///
3280/// Like UnresolvedMemberExprs, these can be either implicit or
3281/// explicit accesses.  It is only possible to get one of these with
3282/// an implicit access if a qualifier is provided.
3283class CXXDependentScopeMemberExpr final
3284    : public Expr,
3285      private llvm::TrailingObjects<CXXDependentScopeMemberExpr,
3286                                    ASTTemplateKWAndArgsInfo,
3287                                    TemplateArgumentLoc, NamedDecl *> {
3288  friend class ASTStmtReader;
3289  friend class ASTStmtWriter;
3290  friend TrailingObjects;
3291
3292  /// The expression for the base pointer or class reference,
3293  /// e.g., the \c x in x.f.  Can be null in implicit accesses.
3294  Stmt *Base;
3295
3296  /// The type of the base expression.  Never null, even for
3297  /// implicit accesses.
3298  QualType BaseType;
3299
3300  /// The nested-name-specifier that precedes the member name, if any.
3301  /// FIXME: This could be in principle store as a trailing object.
3302  /// However the performance impact of doing so should be investigated first.
3303  NestedNameSpecifierLoc QualifierLoc;
3304
3305  /// The member to which this member expression refers, which
3306  /// can be name, overloaded operator, or destructor.
3307  ///
3308  /// FIXME: could also be a template-id
3309  DeclarationNameInfo MemberNameInfo;
3310
3311  // CXXDependentScopeMemberExpr is followed by several trailing objects,
3312  // some of which optional. They are in order:
3313  //
3314  // * An optional ASTTemplateKWAndArgsInfo for the explicitly specified
3315  //   template keyword and arguments. Present if and only if
3316  //   hasTemplateKWAndArgsInfo().
3317  //
3318  // * An array of getNumTemplateArgs() TemplateArgumentLoc containing location
3319  //   information for the explicitly specified template arguments.
3320  //
3321  // * An optional NamedDecl *. In a qualified member access expression such
3322  //   as t->Base::f, this member stores the resolves of name lookup in the
3323  //   context of the member access expression, to be used at instantiation
3324  //   time. Present if and only if hasFirstQualifierFoundInScope().
3325
3326  bool hasTemplateKWAndArgsInfo() const {
3327    return CXXDependentScopeMemberExprBits.HasTemplateKWAndArgsInfo;
3328  }
3329
3330  bool hasFirstQualifierFoundInScope() const {
3331    return CXXDependentScopeMemberExprBits.HasFirstQualifierFoundInScope;
3332  }
3333
3334  unsigned numTrailingObjects(OverloadToken<ASTTemplateKWAndArgsInfo>) const {
3335    return hasTemplateKWAndArgsInfo();
3336  }
3337
3338  unsigned numTrailingObjects(OverloadToken<TemplateArgumentLoc>) const {
3339    return getNumTemplateArgs();
3340  }
3341
3342  unsigned numTrailingObjects(OverloadToken<NamedDecl *>) const {
3343    return hasFirstQualifierFoundInScope();
3344  }
3345
3346  CXXDependentScopeMemberExpr(const ASTContext &CtxExpr *Base,
3347                              QualType BaseTypebool IsArrow,
3348                              SourceLocation OperatorLoc,
3349                              NestedNameSpecifierLoc QualifierLoc,
3350                              SourceLocation TemplateKWLoc,
3351                              NamedDecl *FirstQualifierFoundInScope,
3352                              DeclarationNameInfo MemberNameInfo,
3353                              const TemplateArgumentListInfo *TemplateArgs);
3354
3355  CXXDependentScopeMemberExpr(EmptyShell Emptybool HasTemplateKWAndArgsInfo,
3356                              bool HasFirstQualifierFoundInScope);
3357
3358public:
3359  static CXXDependentScopeMemberExpr *
3360  Create(const ASTContext &CtxExpr *BaseQualType BaseTypebool IsArrow,
3361         SourceLocation OperatorLocNestedNameSpecifierLoc QualifierLoc,
3362         SourceLocation TemplateKWLocNamedDecl *FirstQualifierFoundInScope,
3363         DeclarationNameInfo MemberNameInfo,
3364         const TemplateArgumentListInfo *TemplateArgs);
3365
3366  static CXXDependentScopeMemberExpr *
3367  CreateEmpty(const ASTContext &Ctxbool HasTemplateKWAndArgsInfo,
3368              unsigned NumTemplateArgsbool HasFirstQualifierFoundInScope);
3369
3370  /// True if this is an implicit access, i.e. one in which the
3371  /// member being accessed was not written in the source.  The source
3372  /// location of the operator is invalid in this case.
3373  bool isImplicitAccess() const {
3374    if (!Base)
3375      return true;
3376    return cast<Expr>(Base)->isImplicitCXXThis();
3377  }
3378
3379  /// Retrieve the base object of this member expressions,
3380  /// e.g., the \c x in \c x.m.
3381  Expr *getBase() const {
3382    assert(!isImplicitAccess());
3383    return cast<Expr>(Base);
3384  }
3385
3386  QualType getBaseType() const { return BaseType; }
3387
3388  /// Determine whether this member expression used the '->'
3389  /// operator; otherwise, it used the '.' operator.
3390  bool isArrow() const { return CXXDependentScopeMemberExprBits.IsArrow; }
3391
3392  /// Retrieve the location of the '->' or '.' operator.
3393  SourceLocation getOperatorLoc() const {
3394    return CXXDependentScopeMemberExprBits.OperatorLoc;
3395  }
3396
3397  /// Retrieve the nested-name-specifier that qualifies the member name.
3398  NestedNameSpecifier *getQualifier() const {
3399    return QualifierLoc.getNestedNameSpecifier();
3400  }
3401
3402  /// Retrieve the nested-name-specifier that qualifies the member
3403  /// name, with source location information.
3404  NestedNameSpecifierLoc getQualifierLoc() const { return QualifierLoc; }
3405
3406  /// Retrieve the first part of the nested-name-specifier that was
3407  /// found in the scope of the member access expression when the member access
3408  /// was initially parsed.
3409  ///
3410  /// This function only returns a useful result when member access expression
3411  /// uses a qualified member name, e.g., "x.Base::f". Here, the declaration
3412  /// returned by this function describes what was found by unqualified name
3413  /// lookup for the identifier "Base" within the scope of the member access
3414  /// expression itself. At template instantiation time, this information is
3415  /// combined with the results of name lookup into the type of the object
3416  /// expression itself (the class type of x).
3417  NamedDecl *getFirstQualifierFoundInScope() const {
3418    if (!hasFirstQualifierFoundInScope())
3419      return nullptr;
3420    return *getTrailingObjects<NamedDecl *>();
3421  }
3422
3423  /// Retrieve the name of the member that this expression refers to.
3424  const DeclarationNameInfo &getMemberNameInfo() const {
3425    return MemberNameInfo;
3426  }
3427
3428  /// Retrieve the name of the member that this expression refers to.
3429  DeclarationName getMember() const { return MemberNameInfo.getName(); }
3430
3431  // Retrieve the location of the name of the member that this
3432  // expression refers to.
3433  SourceLocation getMemberLoc() const { return MemberNameInfo.getLoc(); }
3434
3435  /// Retrieve the location of the template keyword preceding the
3436  /// member name, if any.
3437  SourceLocation getTemplateKeywordLoc() const {
3438    if (!hasTemplateKWAndArgsInfo())
3439      return SourceLocation();
3440    return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->TemplateKWLoc;
3441  }
3442
3443  /// Retrieve the location of the left angle bracket starting the
3444  /// explicit template argument list following the member name, if any.
3445  SourceLocation getLAngleLoc() const {
3446    if (!hasTemplateKWAndArgsInfo())
3447      return SourceLocation();
3448    return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->LAngleLoc;
3449  }
3450
3451  /// Retrieve the location of the right angle bracket ending the
3452  /// explicit template argument list following the member name, if any.
3453  SourceLocation getRAngleLoc() const {
3454    if (!hasTemplateKWAndArgsInfo())
3455      return SourceLocation();
3456    return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->RAngleLoc;
3457  }
3458
3459  /// Determines whether the member name was preceded by the template keyword.
3460  bool hasTemplateKeyword() const { return getTemplateKeywordLoc().isValid(); }
3461
3462  /// Determines whether this member expression actually had a C++
3463  /// template argument list explicitly specified, e.g., x.f<int>.
3464  bool hasExplicitTemplateArgs() const { return getLAngleLoc().isValid(); }
3465
3466  /// Copies the template arguments (if present) into the given
3467  /// structure.
3468  void copyTemplateArgumentsInto(TemplateArgumentListInfo &Listconst {
3469    if (hasExplicitTemplateArgs())
3470      getTrailingObjects<ASTTemplateKWAndArgsInfo>()->copyInto(
3471          getTrailingObjects<TemplateArgumentLoc>(), List);
3472  }
3473
3474  /// Retrieve the template arguments provided as part of this
3475  /// template-id.
3476  const TemplateArgumentLoc *getTemplateArgs() const {
3477    if (!hasExplicitTemplateArgs())
3478      return nullptr;
3479
3480    return getTrailingObjects<TemplateArgumentLoc>();
3481  }
3482
3483  /// Retrieve the number of template arguments provided as part of this
3484  /// template-id.
3485  unsigned getNumTemplateArgs() const {
3486    if (!hasExplicitTemplateArgs())
3487      return 0;
3488
3489    return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->NumTemplateArgs;
3490  }
3491
3492  ArrayRef<TemplateArgumentLoctemplate_arguments() const {
3493    return {getTemplateArgs(), getNumTemplateArgs()};
3494  }
3495
3496  SourceLocation getBeginLoc() const LLVM_READONLY {
3497    if (!isImplicitAccess())
3498      return Base->getBeginLoc();
3499    if (getQualifier())
3500      return getQualifierLoc().getBeginLoc();
3501    return MemberNameInfo.getBeginLoc();
3502  }
3503
3504  SourceLocation getEndLoc() const LLVM_READONLY {
3505    if (hasExplicitTemplateArgs())
3506      return getRAngleLoc();
3507    return MemberNameInfo.getEndLoc();
3508  }
3509
3510  static bool classof(const Stmt *T) {
3511    return T->getStmtClass() == CXXDependentScopeMemberExprClass;
3512  }
3513
3514  // Iterators
3515  child_range children() {
3516    if (isImplicitAccess())
3517      return child_range(child_iterator(), child_iterator());
3518    return child_range(&Base, &Base + 1);
3519  }
3520};
3521
3522/// Represents a C++ member access expression for which lookup
3523/// produced a set of overloaded functions.
3524///
3525/// The member access may be explicit or implicit:
3526/// \code
3527///    struct A {
3528///      int a, b;
3529///      int explicitAccess() { return this->a + this->A::b; }
3530///      int implicitAccess() { return a + A::b; }
3531///    };
3532/// \endcode
3533///
3534/// In the final AST, an explicit access always becomes a MemberExpr.
3535/// An implicit access may become either a MemberExpr or a
3536/// DeclRefExpr, depending on whether the member is static.
3537class UnresolvedMemberExpr final
3538    : public OverloadExpr,
3539      private llvm::TrailingObjects<UnresolvedMemberExpr, DeclAccessPair,
3540                                    ASTTemplateKWAndArgsInfo,
3541                                    TemplateArgumentLoc> {
3542  friend class ASTStmtReader;
3543  friend class OverloadExpr;
3544  friend TrailingObjects;
3545
3546  /// The expression for the base pointer or class reference,
3547  /// e.g., the \c x in x.f.
3548  ///
3549  /// This can be null if this is an 'unbased' member expression.
3550  Stmt *Base;
3551
3552  /// The type of the base expression; never null.
3553  QualType BaseType;
3554
3555  /// The location of the '->' or '.' operator.
3556  SourceLocation OperatorLoc;
3557
3558  // UnresolvedMemberExpr is followed by several trailing objects.
3559  // They are in order:
3560  //
3561  // * An array of getNumResults() DeclAccessPair for the results. These are
3562  //   undesugared, which is to say, they may include UsingShadowDecls.
3563  //   Access is relative to the naming class.
3564  //
3565  // * An optional ASTTemplateKWAndArgsInfo for the explicitly specified
3566  //   template keyword and arguments. Present if and only if
3567  //   hasTemplateKWAndArgsInfo().
3568  //
3569  // * An array of getNumTemplateArgs() TemplateArgumentLoc containing
3570  //   location information for the explicitly specified template arguments.
3571
3572  UnresolvedMemberExpr(const ASTContext &Contextbool HasUnresolvedUsing,
3573                       Expr *BaseQualType BaseTypebool IsArrow,
3574                       SourceLocation OperatorLoc,
3575                       NestedNameSpecifierLoc QualifierLoc,
3576                       SourceLocation TemplateKWLoc,
3577                       const DeclarationNameInfo &MemberNameInfo,
3578                       const TemplateArgumentListInfo *TemplateArgs,
3579                       UnresolvedSetIterator BeginUnresolvedSetIterator End);
3580
3581  UnresolvedMemberExpr(EmptyShell Emptyunsigned NumResults,
3582                       bool HasTemplateKWAndArgsInfo);
3583
3584  unsigned numTrailingObjects(OverloadToken<DeclAccessPair>) const {
3585    return getNumDecls();
3586  }
3587
3588  unsigned numTrailingObjects(OverloadToken<ASTTemplateKWAndArgsInfo>) const {
3589    return hasTemplateKWAndArgsInfo();
3590  }
3591
3592public:
3593  static UnresolvedMemberExpr *
3594  Create(const ASTContext &Contextbool HasUnresolvedUsingExpr *Base,
3595         QualType BaseTypebool IsArrowSourceLocation OperatorLoc,
3596         NestedNameSpecifierLoc QualifierLocSourceLocation TemplateKWLoc,
3597         const DeclarationNameInfo &MemberNameInfo,
3598         const TemplateArgumentListInfo *TemplateArgs,
3599         UnresolvedSetIterator BeginUnresolvedSetIterator End);
3600
3601  static UnresolvedMemberExpr *CreateEmpty(const ASTContext &Context,
3602                                           unsigned NumResults,
3603                                           bool HasTemplateKWAndArgsInfo,
3604                                           unsigned NumTemplateArgs);
3605
3606  /// True if this is an implicit access, i.e., one in which the
3607  /// member being accessed was not written in the source.
3608  ///
3609  /// The source location of the operator is invalid in this case.
3610  bool isImplicitAccess() const;
3611
3612  /// Retrieve the base object of this member expressions,
3613  /// e.g., the \c x in \c x.m.
3614  Expr *getBase() {
3615    assert(!isImplicitAccess());
3616    return cast<Expr>(Base);
3617  }
3618  const Expr *getBase() const {
3619    assert(!isImplicitAccess());
3620    return cast<Expr>(Base);
3621  }
3622
3623  QualType getBaseType() const { return BaseType; }
3624
3625  /// Determine whether the lookup results contain an unresolved using
3626  /// declaration.
3627  bool hasUnresolvedUsing() const {
3628    return UnresolvedMemberExprBits.HasUnresolvedUsing;
3629  }
3630
3631  /// Determine whether this member expression used the '->'
3632  /// operator; otherwise, it used the '.' operator.
3633  bool isArrow() const { return UnresolvedMemberExprBits.IsArrow; }
3634
3635  /// Retrieve the location of the '->' or '.' operator.
3636  SourceLocation getOperatorLoc() const { return OperatorLoc; }
3637
3638  /// Retrieve the naming class of this lookup.
3639  CXXRecordDecl *getNamingClass();
3640  const CXXRecordDecl *getNamingClass() const {
3641    return const_cast<UnresolvedMemberExpr *>(this)->getNamingClass();
3642  }
3643
3644  /// Retrieve the full name info for the member that this expression
3645  /// refers to.
3646  const DeclarationNameInfo &getMemberNameInfo() const { return getNameInfo(); }
3647
3648  /// Retrieve the name of the member that this expression refers to.
3649  DeclarationName getMemberName() const { return getName(); }
3650
3651  /// Retrieve the location of the name of the member that this
3652  /// expression refers to.
3653  SourceLocation getMemberLoc() const { return getNameLoc(); }
3654
3655  /// Return the preferred location (the member name) for the arrow when
3656  /// diagnosing a problem with this expression.
3657  SourceLocation getExprLoc() const LLVM_READONLY { return getMemberLoc(); }
3658
3659  SourceLocation getBeginLoc() const LLVM_READONLY {
3660    if (!isImplicitAccess())
3661      return Base->getBeginLoc();
3662    if (NestedNameSpecifierLoc l = getQualifierLoc())
3663      return l.getBeginLoc();
3664    return getMemberNameInfo().getBeginLoc();
3665  }
3666
3667  SourceLocation getEndLoc() const LLVM_READONLY {
3668    if (hasExplicitTemplateArgs())
3669      return getRAngleLoc();
3670    return getMemberNameInfo().getEndLoc();
3671  }
3672
3673  static bool classof(const Stmt *T) {
3674    return T->getStmtClass() == UnresolvedMemberExprClass;
3675  }
3676
3677  // Iterators
3678  child_range children() {
3679    if (isImplicitAccess())
3680      return child_range(child_iterator(), child_iterator());
3681    return child_range(&Base, &Base + 1);
3682  }
3683};
3684
3685DeclAccessPair *OverloadExpr::getTrailingResults() {
3686  if (auto *ULE = dyn_cast<UnresolvedLookupExpr>(this))
3687    return ULE->getTrailingObjects<DeclAccessPair>();
3688  return cast<UnresolvedMemberExpr>(this)->getTrailingObjects<DeclAccessPair>();
3689}
3690
3691ASTTemplateKWAndArgsInfo *OverloadExpr::getTrailingASTTemplateKWAndArgsInfo() {
3692  if (!hasTemplateKWAndArgsInfo())
3693    return nullptr;
3694
3695  if (auto *ULE = dyn_cast<UnresolvedLookupExpr>(this))
3696    return ULE->getTrailingObjects<ASTTemplateKWAndArgsInfo>();
3697  return cast<UnresolvedMemberExpr>(this)
3698      ->getTrailingObjects<ASTTemplateKWAndArgsInfo>();
3699}
3700
3701TemplateArgumentLoc *OverloadExpr::getTrailingTemplateArgumentLoc() {
3702  if (auto *ULE = dyn_cast<UnresolvedLookupExpr>(this))
3703    return ULE->getTrailingObjects<TemplateArgumentLoc>();
3704  return cast<UnresolvedMemberExpr>(this)
3705      ->getTrailingObjects<TemplateArgumentLoc>();
3706}
3707
3708CXXRecordDecl *OverloadExpr::getNamingClass() {
3709  if (auto *ULE = dyn_cast<UnresolvedLookupExpr>(this))
3710    return ULE->getNamingClass();
3711  return cast<UnresolvedMemberExpr>(this)->getNamingClass();
3712}
3713
3714/// Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
3715///
3716/// The noexcept expression tests whether a given expression might throw. Its
3717/// result is a boolean constant.
3718class CXXNoexceptExpr : public Expr {
3719  friend class ASTStmtReader;
3720
3721  Stmt *Operand;
3722  SourceRange Range;
3723
3724public:
3725  CXXNoexceptExpr(QualType TyExpr *OperandCanThrowResult Val,
3726                  SourceLocation KeywordSourceLocation RParen)
3727      : Expr(CXXNoexceptExprClass, Ty, VK_RValue, OK_Ordinary,
3728             /*TypeDependent*/ false,
3729             /*ValueDependent*/ Val == CT_Dependent,
3730             Val == CT_Dependent || Operand->isInstantiationDependent(),
3731             Operand->containsUnexpandedParameterPack()),
3732        Operand(Operand), Range(KeywordRParen) {
3733    CXXNoexceptExprBits.Value = Val == CT_Cannot;
3734  }
3735
3736  CXXNoexceptExpr(EmptyShell Empty) : Expr(CXXNoexceptExprClass, Empty) {}
3737
3738  Expr *getOperand() const { return static_cast<Expr *>(Operand); }
3739
3740  SourceLocation getBeginLoc() const { return Range.getBegin(); }
3741  SourceLocation getEndLoc() const { return Range.getEnd(); }
3742  SourceRange getSourceRange() const { return Range; }
3743
3744  bool getValue() const { return CXXNoexceptExprBits.Value; }
3745
3746  static bool classof(const Stmt *T) {
3747    return T->getStmtClass() == CXXNoexceptExprClass;
3748  }
3749
3750  // Iterators
3751  child_range children() { return child_range(&Operand, &Operand + 1); }
3752};
3753
3754/// Represents a C++11 pack expansion that produces a sequence of
3755/// expressions.
3756///
3757/// A pack expansion expression contains a pattern (which itself is an
3758/// expression) followed by an ellipsis. For example:
3759///
3760/// \code
3761/// template<typename F, typename ...Types>
3762/// void forward(F f, Types &&...args) {
3763///   f(static_cast<Types&&>(args)...);
3764/// }
3765/// \endcode
3766///
3767/// Here, the argument to the function object \c f is a pack expansion whose
3768/// pattern is \c static_cast<Types&&>(args). When the \c forward function
3769/// template is instantiated, the pack expansion will instantiate to zero or
3770/// or more function arguments to the function object \c f.
3771class PackExpansionExpr : public Expr {
3772  friend class ASTStmtReader;
3773  friend class ASTStmtWriter;
3774
3775  SourceLocation EllipsisLoc;
3776
3777  /// The number of expansions that will be produced by this pack
3778  /// expansion expression, if known.
3779  ///
3780  /// When zero, the number of expansions is not known. Otherwise, this value
3781  /// is the number of expansions + 1.
3782  unsigned NumExpansions;
3783
3784  Stmt *Pattern;
3785
3786public:
3787  PackExpansionExpr(QualType TExpr *PatternSourceLocation EllipsisLoc,
3788                    Optional<unsignedNumExpansions)
3789      : Expr(PackExpansionExprClass, T, Pattern->getValueKind(),
3790             Pattern->getObjectKind(), /*TypeDependent=*/true,
3791             /*ValueDependent=*/true/*InstantiationDependent=*/true,
3792             /*ContainsUnexpandedParameterPack=*/false),
3793        EllipsisLoc(EllipsisLoc),
3794        NumExpansions(NumExpansions ? *NumExpansions + 1 : 0),
3795        Pattern(Pattern) {}
3796
3797  PackExpansionExpr(EmptyShell Empty) : Expr(PackExpansionExprClass, Empty) {}
3798
3799  /// Retrieve the pattern of the pack expansion.
3800  Expr *getPattern() { return reinterpret_cast<Expr *>(Pattern); }
3801
3802  /// Retrieve the pattern of the pack expansion.
3803  const Expr *getPattern() const { return reinterpret_cast<Expr *>(Pattern); }
3804
3805  /// Retrieve the location of the ellipsis that describes this pack
3806  /// expansion.
3807  SourceLocation getEllipsisLoc() const { return EllipsisLoc; }
3808
3809  /// Determine the number of expansions that will be produced when
3810  /// this pack expansion is instantiated, if already known.
3811  Optional<unsignedgetNumExpansions() const {
3812    if (NumExpansions)
3813      return NumExpansions - 1;
3814
3815    return None;
3816  }
3817
3818  SourceLocation getBeginLoc() const LLVM_READONLY {
3819    return Pattern->getBeginLoc();
3820  }
3821
3822  SourceLocation getEndLoc() const LLVM_READONLY { return EllipsisLoc; }
3823
3824  static bool classof(const Stmt *T) {
3825    return T->getStmtClass() == PackExpansionExprClass;
3826  }
3827
3828  // Iterators
3829  child_range children() {
3830    return child_range(&Pattern, &Pattern + 1);
3831  }
3832};
3833
3834/// Represents an expression that computes the length of a parameter
3835/// pack.
3836///
3837/// \code
3838/// template<typename ...Types>
3839/// struct count {
3840///   static const unsigned value = sizeof...(Types);
3841/// };
3842/// \endcode
3843class SizeOfPackExpr final
3844    : public Expr,
3845      private llvm::TrailingObjects<SizeOfPackExpr, TemplateArgument> {
3846  friend class ASTStmtReader;
3847  friend class ASTStmtWriter;
3848  friend TrailingObjects;
3849
3850  /// The location of the \c sizeof keyword.
3851  SourceLocation OperatorLoc;
3852
3853  /// The location of the name of the parameter pack.
3854  SourceLocation PackLoc;
3855
3856  /// The location of the closing parenthesis.
3857  SourceLocation RParenLoc;
3858
3859  /// The length of the parameter pack, if known.
3860  ///
3861  /// When this expression is not value-dependent, this is the length of
3862  /// the pack. When the expression was parsed rather than instantiated
3863  /// (and thus is value-dependent), this is zero.
3864  ///
3865  /// After partial substitution into a sizeof...(X) expression (for instance,
3866  /// within an alias template or during function template argument deduction),
3867  /// we store a trailing array of partially-substituted TemplateArguments,
3868  /// and this is the length of that array.
3869  unsigned Length;
3870
3871  /// The parameter pack.
3872  NamedDecl *Pack = nullptr;
3873
3874  /// Create an expression that computes the length of
3875  /// the given parameter pack.
3876  SizeOfPackExpr(QualType SizeTypeSourceLocation OperatorLocNamedDecl *Pack,
3877                 SourceLocation PackLocSourceLocation RParenLoc,
3878                 Optional<unsignedLengthArrayRef<TemplateArgumentPartialArgs)
3879      : Expr(SizeOfPackExprClass, SizeType, VK_RValue, OK_Ordinary,
3880             /*TypeDependent=*/false/*ValueDependent=*/!Length,
3881             /*InstantiationDependent=*/!Length,
3882             /*ContainsUnexpandedParameterPack=*/false),
3883        OperatorLoc(OperatorLoc), PackLoc(PackLoc), RParenLoc(RParenLoc),
3884        Length(Length ? *Length : PartialArgs.size()), Pack(Pack) {
3885     (0) . __assert_fail ("(!Length || PartialArgs.empty()) && \"have partial args for non-dependent sizeof... expression\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/ExprCXX.h", 3886, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert((!Length || PartialArgs.empty()) &&
3886 (0) . __assert_fail ("(!Length || PartialArgs.empty()) && \"have partial args for non-dependent sizeof... expression\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/ExprCXX.h", 3886, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "have partial args for non-dependent sizeof... expression");
3887    auto *Args = getTrailingObjects<TemplateArgument>();
3888    std::uninitialized_copy(PartialArgs.begin(), PartialArgs.end(), Args);
3889  }
3890
3891  /// Create an empty expression.
3892  SizeOfPackExpr(EmptyShell Emptyunsigned NumPartialArgs)
3893      : Expr(SizeOfPackExprClass, Empty), Length(NumPartialArgs) {}
3894
3895public:
3896  static SizeOfPackExpr *Create(ASTContext &ContextSourceLocation OperatorLoc,
3897                                NamedDecl *PackSourceLocation PackLoc,
3898                                SourceLocation RParenLoc,
3899                                Optional<unsignedLength = None,
3900                                ArrayRef<TemplateArgumentPartialArgs = None);
3901  static SizeOfPackExpr *CreateDeserialized(ASTContext &Context,
3902                                            unsigned NumPartialArgs);
3903
3904  /// Determine the location of the 'sizeof' keyword.
3905  SourceLocation getOperatorLoc() const { return OperatorLoc; }
3906
3907  /// Determine the location of the parameter pack.
3908  SourceLocation getPackLoc() const { return PackLoc; }
3909
3910  /// Determine the location of the right parenthesis.
3911  SourceLocation getRParenLoc() const { return RParenLoc; }
3912
3913  /// Retrieve the parameter pack.
3914  NamedDecl *getPack() const { return Pack; }
3915
3916  /// Retrieve the length of the parameter pack.
3917  ///
3918  /// This routine may only be invoked when the expression is not
3919  /// value-dependent.
3920  unsigned getPackLength() const {
3921     (0) . __assert_fail ("!isValueDependent() && \"Cannot get the length of a value-dependent pack size expression\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/ExprCXX.h", 3922, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(!isValueDependent() &&
3922 (0) . __assert_fail ("!isValueDependent() && \"Cannot get the length of a value-dependent pack size expression\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/ExprCXX.h", 3922, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "Cannot get the length of a value-dependent pack size expression");
3923    return Length;
3924  }
3925
3926  /// Determine whether this represents a partially-substituted sizeof...
3927  /// expression, such as is produced for:
3928  ///
3929  ///   template<typename ...Ts> using X = int[sizeof...(Ts)];
3930  ///   template<typename ...Us> void f(X<Us..., 1, 2, 3, Us...>);
3931  bool isPartiallySubstituted() const {
3932    return isValueDependent() && Length;
3933  }
3934
3935  /// Get
3936  ArrayRef<TemplateArgumentgetPartialArguments() const {
3937    assert(isPartiallySubstituted());
3938    const auto *Args = getTrailingObjects<TemplateArgument>();
3939    return llvm::makeArrayRef(Args, Args + Length);
3940  }
3941
3942  SourceLocation getBeginLoc() const LLVM_READONLY { return OperatorLoc; }
3943  SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; }
3944
3945  static bool classof(const Stmt *T) {
3946    return T->getStmtClass() == SizeOfPackExprClass;
3947  }
3948
3949  // Iterators
3950  child_range children() {
3951    return child_range(child_iterator(), child_iterator());
3952  }
3953};
3954
3955/// Represents a reference to a non-type template parameter
3956/// that has been substituted with a template argument.
3957class SubstNonTypeTemplateParmExpr : public Expr {
3958  friend class ASTReader;
3959  friend class ASTStmtReader;
3960
3961  /// The replaced parameter.
3962  NonTypeTemplateParmDecl *Param;
3963
3964  /// The replacement expression.
3965  Stmt *Replacement;
3966
3967  explicit SubstNonTypeTemplateParmExpr(EmptyShell Empty)
3968      : Expr(SubstNonTypeTemplateParmExprClass, Empty) {}
3969
3970public:
3971  SubstNonTypeTemplateParmExpr(QualType TyExprValueKind ValueKind,
3972                               SourceLocation Loc,
3973                               NonTypeTemplateParmDecl *Param,
3974                               Expr *Replacement)
3975      : Expr(SubstNonTypeTemplateParmExprClass, Ty, ValueKind, OK_Ordinary,
3976             Replacement->isTypeDependent(), Replacement->isValueDependent(),
3977             Replacement->isInstantiationDependent(),
3978             Replacement->containsUnexpandedParameterPack()),
3979        Param(Param), Replacement(Replacement) {
3980    SubstNonTypeTemplateParmExprBits.NameLoc = Loc;
3981  }
3982
3983  SourceLocation getNameLoc() const {
3984    return SubstNonTypeTemplateParmExprBits.NameLoc;
3985  }
3986  SourceLocation getBeginLoc() const { return getNameLoc(); }
3987  SourceLocation getEndLoc() const { return getNameLoc(); }
3988
3989  Expr *getReplacement() const { return cast<Expr>(Replacement); }
3990
3991  NonTypeTemplateParmDecl *getParameter() const { return Param; }
3992
3993  static bool classof(const Stmt *s) {
3994    return s->getStmtClass() == SubstNonTypeTemplateParmExprClass;
3995  }
3996
3997  // Iterators
3998  child_range children() { return child_range(&Replacement, &Replacement + 1); }
3999};
4000
4001/// Represents a reference to a non-type template parameter pack that
4002/// has been substituted with a non-template argument pack.
4003///
4004/// When a pack expansion in the source code contains multiple parameter packs
4005/// and those parameter packs correspond to different levels of template
4006/// parameter lists, this node is used to represent a non-type template
4007/// parameter pack from an outer level, which has already had its argument pack
4008/// substituted but that still lives within a pack expansion that itself
4009/// could not be instantiated. When actually performing a substitution into
4010/// that pack expansion (e.g., when all template parameters have corresponding
4011/// arguments), this type will be replaced with the appropriate underlying
4012/// expression at the current pack substitution index.
4013class SubstNonTypeTemplateParmPackExpr : public Expr {
4014  friend class ASTReader;
4015  friend class ASTStmtReader;
4016
4017  /// The non-type template parameter pack itself.
4018  NonTypeTemplateParmDecl *Param;
4019
4020  /// A pointer to the set of template arguments that this
4021  /// parameter pack is instantiated with.
4022  const TemplateArgument *Arguments;
4023
4024  /// The number of template arguments in \c Arguments.
4025  unsigned NumArguments;
4026
4027  /// The location of the non-type template parameter pack reference.
4028  SourceLocation NameLoc;
4029
4030  explicit SubstNonTypeTemplateParmPackExpr(EmptyShell Empty)
4031      : Expr(SubstNonTypeTemplateParmPackExprClass, Empty) {}
4032
4033public:
4034  SubstNonTypeTemplateParmPackExpr(QualType T,
4035                                   ExprValueKind ValueKind,
4036                                   NonTypeTemplateParmDecl *Param,
4037                                   SourceLocation NameLoc,
4038                                   const TemplateArgument &ArgPack);
4039
4040  /// Retrieve the non-type template parameter pack being substituted.
4041  NonTypeTemplateParmDecl *getParameterPack() const { return Param; }
4042
4043  /// Retrieve the location of the parameter pack name.
4044  SourceLocation getParameterPackLocation() const { return NameLoc; }
4045
4046  /// Retrieve the template argument pack containing the substituted
4047  /// template arguments.
4048  TemplateArgument getArgumentPack() const;
4049
4050  SourceLocation getBeginLoc() const LLVM_READONLY { return NameLoc; }
4051  SourceLocation getEndLoc() const LLVM_READONLY { return NameLoc; }
4052
4053  static bool classof(const Stmt *T) {
4054    return T->getStmtClass() == SubstNonTypeTemplateParmPackExprClass;
4055  }
4056
4057  // Iterators
4058  child_range children() {
4059    return child_range(child_iterator(), child_iterator());
4060  }
4061};
4062
4063/// Represents a reference to a function parameter pack that has been
4064/// substituted but not yet expanded.
4065///
4066/// When a pack expansion contains multiple parameter packs at different levels,
4067/// this node is used to represent a function parameter pack at an outer level
4068/// which we have already substituted to refer to expanded parameters, but where
4069/// the containing pack expansion cannot yet be expanded.
4070///
4071/// \code
4072/// template<typename...Ts> struct S {
4073///   template<typename...Us> auto f(Ts ...ts) -> decltype(g(Us(ts)...));
4074/// };
4075/// template struct S<int, int>;
4076/// \endcode
4077class FunctionParmPackExpr final
4078    : public Expr,
4079      private llvm::TrailingObjects<FunctionParmPackExpr, ParmVarDecl *> {
4080  friend class ASTReader;
4081  friend class ASTStmtReader;
4082  friend TrailingObjects;
4083
4084  /// The function parameter pack which was referenced.
4085  ParmVarDecl *ParamPack;
4086
4087  /// The location of the function parameter pack reference.
4088  SourceLocation NameLoc;
4089
4090  /// The number of expansions of this pack.
4091  unsigned NumParameters;
4092
4093  FunctionParmPackExpr(QualType TParmVarDecl *ParamPack,
4094                       SourceLocation NameLocunsigned NumParams,
4095                       ParmVarDecl *const *Params);
4096
4097public:
4098  static FunctionParmPackExpr *Create(const ASTContext &ContextQualType T,
4099                                      ParmVarDecl *ParamPack,
4100                                      SourceLocation NameLoc,
4101                                      ArrayRef<ParmVarDecl *> Params);
4102  static FunctionParmPackExpr *CreateEmpty(const ASTContext &Context,
4103                                           unsigned NumParams);
4104
4105  /// Get the parameter pack which this expression refers to.
4106  ParmVarDecl *getParameterPack() const { return ParamPack; }
4107
4108  /// Get the location of the parameter pack.
4109  SourceLocation getParameterPackLocation() const { return NameLoc; }
4110
4111  /// Iterators over the parameters which the parameter pack expanded
4112  /// into.
4113  using iterator = ParmVarDecl * const *;
4114  iterator begin() const { return getTrailingObjects<ParmVarDecl *>(); }
4115  iterator end() const { return begin() + NumParameters; }
4116
4117  /// Get the number of parameters in this parameter pack.
4118  unsigned getNumExpansions() const { return NumParameters; }
4119
4120  /// Get an expansion of the parameter pack by index.
4121  ParmVarDecl *getExpansion(unsigned Iconst { return begin()[I]; }
4122
4123  SourceLocation getBeginLoc() const LLVM_READONLY { return NameLoc; }
4124  SourceLocation getEndLoc() const LLVM_READONLY { return NameLoc; }
4125
4126  static bool classof(const Stmt *T) {
4127    return T->getStmtClass() == FunctionParmPackExprClass;
4128  }
4129
4130  child_range children() {
4131    return child_range(child_iterator(), child_iterator());
4132  }
4133};
4134
4135/// Represents a prvalue temporary that is written into memory so that
4136/// a reference can bind to it.
4137///
4138/// Prvalue expressions are materialized when they need to have an address
4139/// in memory for a reference to bind to. This happens when binding a
4140/// reference to the result of a conversion, e.g.,
4141///
4142/// \code
4143/// const int &r = 1.0;
4144/// \endcode
4145///
4146/// Here, 1.0 is implicitly converted to an \c int. That resulting \c int is
4147/// then materialized via a \c MaterializeTemporaryExpr, and the reference
4148/// binds to the temporary. \c MaterializeTemporaryExprs are always glvalues
4149/// (either an lvalue or an xvalue, depending on the kind of reference binding
4150/// to it), maintaining the invariant that references always bind to glvalues.
4151///
4152/// Reference binding and copy-elision can both extend the lifetime of a
4153/// temporary. When either happens, the expression will also track the
4154/// declaration which is responsible for the lifetime extension.
4155class MaterializeTemporaryExpr : public Expr {
4156private:
4157  friend class ASTStmtReader;
4158  friend class ASTStmtWriter;
4159
4160  struct ExtraState {
4161    /// The temporary-generating expression whose value will be
4162    /// materialized.
4163    Stmt *Temporary;
4164
4165    /// The declaration which lifetime-extended this reference, if any.
4166    /// Either a VarDecl, or (for a ctor-initializer) a FieldDecl.
4167    const ValueDecl *ExtendingDecl;
4168
4169    unsigned ManglingNumber;
4170  };
4171  llvm::PointerUnion<Stmt *, ExtraState *> State;
4172
4173  void initializeExtraState(const ValueDecl *ExtendedBy,
4174                            unsigned ManglingNumber);
4175
4176public:
4177  MaterializeTemporaryExpr(QualType TExpr *Temporary,
4178                           bool BoundToLvalueReference)
4179      : Expr(MaterializeTemporaryExprClass, T,
4180             BoundToLvalueReference? VK_LValue : VK_XValue, OK_Ordinary,
4181             Temporary->isTypeDependent(), Temporary->isValueDependent(),
4182             Temporary->isInstantiationDependent(),
4183             Temporary->containsUnexpandedParameterPack()),
4184        State(Temporary) {}
4185
4186  MaterializeTemporaryExpr(EmptyShell Empty)
4187      : Expr(MaterializeTemporaryExprClass, Empty) {}
4188
4189  Stmt *getTemporary() const {
4190    return State.is<Stmt *>() ? State.get<Stmt *>()
4191                              : State.get<ExtraState *>()->Temporary;
4192  }
4193
4194  /// Retrieve the temporary-generating subexpression whose value will
4195  /// be materialized into a glvalue.
4196  Expr *GetTemporaryExpr() const { return static_cast<Expr *>(getTemporary()); }
4197
4198  /// Retrieve the storage duration for the materialized temporary.
4199  StorageDuration getStorageDuration() const {
4200    const ValueDecl *ExtendingDecl = getExtendingDecl();
4201    if (!ExtendingDecl)
4202      return SD_FullExpression;
4203    // FIXME: This is not necessarily correct for a temporary materialized
4204    // within a default initializer.
4205    if (isa<FieldDecl>(ExtendingDecl))
4206      return SD_Automatic;
4207    // FIXME: This only works because storage class specifiers are not allowed
4208    // on decomposition declarations.
4209    if (isa<BindingDecl>(ExtendingDecl))
4210      return ExtendingDecl->getDeclContext()->isFunctionOrMethod()
4211                 ? SD_Automatic
4212                 : SD_Static;
4213    return cast<VarDecl>(ExtendingDecl)->getStorageDuration();
4214  }
4215
4216  /// Get the declaration which triggered the lifetime-extension of this
4217  /// temporary, if any.
4218  const ValueDecl *getExtendingDecl() const {
4219    return State.is<Stmt *>() ? nullptr
4220                              : State.get<ExtraState *>()->ExtendingDecl;
4221  }
4222
4223  void setExtendingDecl(const ValueDecl *ExtendedByunsigned ManglingNumber);
4224
4225  unsigned getManglingNumber() const {
4226    return State.is<Stmt *>() ? 0 : State.get<ExtraState *>()->ManglingNumber;
4227  }
4228
4229  /// Determine whether this materialized temporary is bound to an
4230  /// lvalue reference; otherwise, it's bound to an rvalue reference.
4231  bool isBoundToLvalueReference() const {
4232    return getValueKind() == VK_LValue;
4233  }
4234
4235  SourceLocation getBeginLoc() const LLVM_READONLY {
4236    return getTemporary()->getBeginLoc();
4237  }
4238
4239  SourceLocation getEndLoc() const LLVM_READONLY {
4240    return getTemporary()->getEndLoc();
4241  }
4242
4243  static bool classof(const Stmt *T) {
4244    return T->getStmtClass() == MaterializeTemporaryExprClass;
4245  }
4246
4247  // Iterators
4248  child_range children() {
4249    if (State.is<Stmt *>())
4250      return child_range(State.getAddrOfPtr1(), State.getAddrOfPtr1() + 1);
4251
4252    auto ES = State.get<ExtraState *>();
4253    return child_range(&ES->Temporary, &ES->Temporary + 1);
4254  }
4255};
4256
4257/// Represents a folding of a pack over an operator.
4258///
4259/// This expression is always dependent and represents a pack expansion of the
4260/// forms:
4261///
4262///    ( expr op ... )
4263///    ( ... op expr )
4264///    ( expr op ... op expr )
4265class CXXFoldExpr : public Expr {
4266  friend class ASTStmtReader;
4267  friend class ASTStmtWriter;
4268
4269  SourceLocation LParenLoc;
4270  SourceLocation EllipsisLoc;
4271  SourceLocation RParenLoc;
4272  Stmt *SubExprs[2];
4273  BinaryOperatorKind Opcode;
4274
4275public:
4276  CXXFoldExpr(QualType TSourceLocation LParenLocExpr *LHS,
4277              BinaryOperatorKind OpcodeSourceLocation EllipsisLocExpr *RHS,
4278              SourceLocation RParenLoc)
4279      : Expr(CXXFoldExprClass, T, VK_RValue, OK_Ordinary,
4280             /*Dependent*/ truetruetrue,
4281             /*ContainsUnexpandedParameterPack*/ false),
4282        LParenLoc(LParenLoc), EllipsisLoc(EllipsisLoc), RParenLoc(RParenLoc),
4283        Opcode(Opcode) {
4284    SubExprs[0] = LHS;
4285    SubExprs[1] = RHS;
4286  }
4287
4288  CXXFoldExpr(EmptyShell Empty) : Expr(CXXFoldExprClass, Empty) {}
4289
4290  Expr *getLHS() const { return static_cast<Expr*>(SubExprs[0]); }
4291  Expr *getRHS() const { return static_cast<Expr*>(SubExprs[1]); }
4292
4293  /// Does this produce a right-associated sequence of operators?
4294  bool isRightFold() const {
4295    return getLHS() && getLHS()->containsUnexpandedParameterPack();
4296  }
4297
4298  /// Does this produce a left-associated sequence of operators?
4299  bool isLeftFold() const { return !isRightFold(); }
4300
4301  /// Get the pattern, that is, the operand that contains an unexpanded pack.
4302  Expr *getPattern() const { return isLeftFold() ? getRHS() : getLHS(); }
4303
4304  /// Get the operand that doesn't contain a pack, for a binary fold.
4305  Expr *getInit() const { return isLeftFold() ? getLHS() : getRHS(); }
4306
4307  SourceLocation getEllipsisLoc() const { return EllipsisLoc; }
4308  BinaryOperatorKind getOperator() const { return Opcode; }
4309
4310  SourceLocation getBeginLoc() const LLVM_READONLY { return LParenLoc; }
4311
4312  SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; }
4313
4314  static bool classof(const Stmt *T) {
4315    return T->getStmtClass() == CXXFoldExprClass;
4316  }
4317
4318  // Iterators
4319  child_range children() { return child_range(SubExprs, SubExprs + 2); }
4320};
4321
4322/// Represents an expression that might suspend coroutine execution;
4323/// either a co_await or co_yield expression.
4324///
4325/// Evaluation of this expression first evaluates its 'ready' expression. If
4326/// that returns 'false':
4327///  -- execution of the coroutine is suspended
4328///  -- the 'suspend' expression is evaluated
4329///     -- if the 'suspend' expression returns 'false', the coroutine is
4330///        resumed
4331///     -- otherwise, control passes back to the resumer.
4332/// If the coroutine is not suspended, or when it is resumed, the 'resume'
4333/// expression is evaluated, and its result is the result of the overall
4334/// expression.
4335class CoroutineSuspendExpr : public Expr {
4336  friend class ASTStmtReader;
4337
4338  SourceLocation KeywordLoc;
4339
4340  enum SubExpr { CommonReadySuspendResumeCount };
4341
4342  Stmt *SubExprs[SubExpr::Count];
4343  OpaqueValueExpr *OpaqueValue = nullptr;
4344
4345public:
4346  CoroutineSuspendExpr(StmtClass SCSourceLocation KeywordLocExpr *Common,
4347                       Expr *ReadyExpr *SuspendExpr *Resume,
4348                       OpaqueValueExpr *OpaqueValue)
4349      : Expr(SCResume->getType(), Resume->getValueKind(),
4350             Resume->getObjectKind(), Resume->isTypeDependent(),
4351             Resume->isValueDependent(), Common->isInstantiationDependent(),
4352             Common->containsUnexpandedParameterPack()),
4353        KeywordLoc(KeywordLoc), OpaqueValue(OpaqueValue) {
4354    SubExprs[SubExpr::Common] = Common;
4355    SubExprs[SubExpr::Ready] = Ready;
4356    SubExprs[SubExpr::Suspend] = Suspend;
4357    SubExprs[SubExpr::Resume] = Resume;
4358  }
4359
4360  CoroutineSuspendExpr(StmtClass SCSourceLocation KeywordLocQualType Ty,
4361                       Expr *Common)
4362      : Expr(SCTyVK_RValueOK_Ordinarytruetruetrue,
4363             Common->containsUnexpandedParameterPack()),
4364        KeywordLoc(KeywordLoc) {
4365     (0) . __assert_fail ("Common->isTypeDependent() && Ty->isDependentType() && \"wrong constructor for non-dependent co_await/co_yield expression\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/ExprCXX.h", 4366, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(Common->isTypeDependent() && Ty->isDependentType() &&
4366 (0) . __assert_fail ("Common->isTypeDependent() && Ty->isDependentType() && \"wrong constructor for non-dependent co_await/co_yield expression\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/ExprCXX.h", 4366, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "wrong constructor for non-dependent co_await/co_yield expression");
4367    SubExprs[SubExpr::Common] = Common;
4368    SubExprs[SubExpr::Ready] = nullptr;
4369    SubExprs[SubExpr::Suspend] = nullptr;
4370    SubExprs[SubExpr::Resume] = nullptr;
4371  }
4372
4373  CoroutineSuspendExpr(StmtClass SCEmptyShell Empty) : Expr(SCEmpty) {
4374    SubExprs[SubExpr::Common] = nullptr;
4375    SubExprs[SubExpr::Ready] = nullptr;
4376    SubExprs[SubExpr::Suspend] = nullptr;
4377    SubExprs[SubExpr::Resume] = nullptr;
4378  }
4379
4380  SourceLocation getKeywordLoc() const { return KeywordLoc; }
4381
4382  Expr *getCommonExpr() const {
4383    return static_cast<Expr*>(SubExprs[SubExpr::Common]);
4384  }
4385
4386  /// getOpaqueValue - Return the opaque value placeholder.
4387  OpaqueValueExpr *getOpaqueValue() const { return OpaqueValue; }
4388
4389  Expr *getReadyExpr() const {
4390    return static_cast<Expr*>(SubExprs[SubExpr::Ready]);
4391  }
4392
4393  Expr *getSuspendExpr() const {
4394    return static_cast<Expr*>(SubExprs[SubExpr::Suspend]);
4395  }
4396
4397  Expr *getResumeExpr() const {
4398    return static_cast<Expr*>(SubExprs[SubExpr::Resume]);
4399  }
4400
4401  SourceLocation getBeginLoc() const LLVM_READONLY { return KeywordLoc; }
4402
4403  SourceLocation getEndLoc() const LLVM_READONLY {
4404    return getCommonExpr()->getEndLoc();
4405  }
4406
4407  child_range children() {
4408    return child_range(SubExprs, SubExprs + SubExpr::Count);
4409  }
4410
4411  static bool classof(const Stmt *T) {
4412    return T->getStmtClass() == CoawaitExprClass ||
4413           T->getStmtClass() == CoyieldExprClass;
4414  }
4415};
4416
4417/// Represents a 'co_await' expression.
4418class CoawaitExpr : public CoroutineSuspendExpr {
4419  friend class ASTStmtReader;
4420
4421public:
4422  CoawaitExpr(SourceLocation CoawaitLocExpr *OperandExpr *Ready,
4423              Expr *SuspendExpr *ResumeOpaqueValueExpr *OpaqueValue,
4424              bool IsImplicit = false)
4425      : CoroutineSuspendExpr(CoawaitExprClass, CoawaitLoc, Operand, Ready,
4426                             Suspend, Resume, OpaqueValue) {
4427    CoawaitBits.IsImplicit = IsImplicit;
4428  }
4429
4430  CoawaitExpr(SourceLocation CoawaitLocQualType TyExpr *Operand,
4431              bool IsImplicit = false)
4432      : CoroutineSuspendExpr(CoawaitExprClass, CoawaitLoc, Ty, Operand) {
4433    CoawaitBits.IsImplicit = IsImplicit;
4434  }
4435
4436  CoawaitExpr(EmptyShell Empty)
4437      : CoroutineSuspendExpr(CoawaitExprClass, Empty) {}
4438
4439  Expr *getOperand() const {
4440    // FIXME: Dig out the actual operand or store it.
4441    return getCommonExpr();
4442  }
4443
4444  bool isImplicit() const { return CoawaitBits.IsImplicit; }
4445  void setIsImplicit(bool value = true) { CoawaitBits.IsImplicit = value; }
4446
4447  static bool classof(const Stmt *T) {
4448    return T->getStmtClass() == CoawaitExprClass;
4449  }
4450};
4451
4452/// Represents a 'co_await' expression while the type of the promise
4453/// is dependent.
4454class DependentCoawaitExpr : public Expr {
4455  friend class ASTStmtReader;
4456
4457  SourceLocation KeywordLoc;
4458  Stmt *SubExprs[2];
4459
4460public:
4461  DependentCoawaitExpr(SourceLocation KeywordLocQualType TyExpr *Op,
4462                       UnresolvedLookupExpr *OpCoawait)
4463      : Expr(DependentCoawaitExprClass, Ty, VK_RValue, OK_Ordinary,
4464             /*TypeDependent*/ true/*ValueDependent*/ true,
4465             /*InstantiationDependent*/ true,
4466             Op->containsUnexpandedParameterPack()),
4467        KeywordLoc(KeywordLoc) {
4468    // NOTE: A co_await expression is dependent on the coroutines promise
4469    // type and may be dependent even when the `Op` expression is not.
4470     (0) . __assert_fail ("Ty->isDependentType() && \"wrong constructor for non-dependent co_await/co_yield expression\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/ExprCXX.h", 4471, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(Ty->isDependentType() &&
4471 (0) . __assert_fail ("Ty->isDependentType() && \"wrong constructor for non-dependent co_await/co_yield expression\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/ExprCXX.h", 4471, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "wrong constructor for non-dependent co_await/co_yield expression");
4472    SubExprs[0] = Op;
4473    SubExprs[1] = OpCoawait;
4474  }
4475
4476  DependentCoawaitExpr(EmptyShell Empty)
4477      : Expr(DependentCoawaitExprClass, Empty) {}
4478
4479  Expr *getOperand() const { return cast<Expr>(SubExprs[0]); }
4480
4481  UnresolvedLookupExpr *getOperatorCoawaitLookup() const {
4482    return cast<UnresolvedLookupExpr>(SubExprs[1]);
4483  }
4484
4485  SourceLocation getKeywordLoc() const { return KeywordLoc; }
4486
4487  SourceLocation getBeginLoc() const LLVM_READONLY { return KeywordLoc; }
4488
4489  SourceLocation getEndLoc() const LLVM_READONLY {
4490    return getOperand()->getEndLoc();
4491  }
4492
4493  child_range children() { return child_range(SubExprs, SubExprs + 2); }
4494
4495  static bool classof(const Stmt *T) {
4496    return T->getStmtClass() == DependentCoawaitExprClass;
4497  }
4498};
4499
4500/// Represents a 'co_yield' expression.
4501class CoyieldExpr : public CoroutineSuspendExpr {
4502  friend class ASTStmtReader;
4503
4504public:
4505  CoyieldExpr(SourceLocation CoyieldLocExpr *OperandExpr *Ready,
4506              Expr *SuspendExpr *ResumeOpaqueValueExpr *OpaqueValue)
4507      : CoroutineSuspendExpr(CoyieldExprClass, CoyieldLoc, Operand, Ready,
4508                             Suspend, Resume, OpaqueValue) {}
4509  CoyieldExpr(SourceLocation CoyieldLocQualType TyExpr *Operand)
4510      : CoroutineSuspendExpr(CoyieldExprClass, CoyieldLoc, Ty, Operand) {}
4511  CoyieldExpr(EmptyShell Empty)
4512      : CoroutineSuspendExpr(CoyieldExprClass, Empty) {}
4513
4514  Expr *getOperand() const {
4515    // FIXME: Dig out the actual operand or store it.
4516    return getCommonExpr();
4517  }
4518
4519  static bool classof(const Stmt *T) {
4520    return T->getStmtClass() == CoyieldExprClass;
4521  }
4522};
4523
4524// namespace clang
4525
4526#endif // LLVM_CLANG_AST_EXPRCXX_H
4527
clang::CXXOperatorCallExpr::Range
clang::CXXOperatorCallExpr::getSourceRangeImpl
clang::CXXOperatorCallExpr::Create
clang::CXXOperatorCallExpr::CreateEmpty
clang::CXXOperatorCallExpr::getOperator
clang::CXXOperatorCallExpr::isAssignmentOp
clang::CXXOperatorCallExpr::isAssignmentOp
clang::CXXOperatorCallExpr::isInfixBinaryOp
clang::CXXOperatorCallExpr::getOperatorLoc
clang::CXXOperatorCallExpr::getExprLoc
clang::CXXMemberCallExpr::Create
clang::CXXMemberCallExpr::CreateEmpty
clang::CXXMemberCallExpr::getImplicitObjectArgument
clang::CXXMemberCallExpr::getMethodDecl
clang::CXXMemberCallExpr::getRecordDecl
clang::CXXMemberCallExpr::getExprLoc
clang::CUDAKernelCallExpr::Create
clang::CUDAKernelCallExpr::CreateEmpty
clang::CUDAKernelCallExpr::getConfig
clang::CUDAKernelCallExpr::getConfig
clang::CUDAKernelCallExpr::setConfig
clang::CUDAKernelCallExpr::classof
clang::CXXNamedCastExpr::Loc
clang::CXXNamedCastExpr::RParenLoc
clang::CXXNamedCastExpr::AngleBrackets
clang::CXXNamedCastExpr::getCastName
clang::CXXNamedCastExpr::getOperatorLoc
clang::CXXNamedCastExpr::getRParenLoc
clang::CXXNamedCastExpr::getBeginLoc
clang::CXXStaticCastExpr::Create
clang::CXXStaticCastExpr::CreateEmpty
clang::CXXStaticCastExpr::classof
clang::CXXDynamicCastExpr::Create
clang::CXXDynamicCastExpr::CreateEmpty
clang::CXXDynamicCastExpr::isAlwaysNull
clang::CXXDynamicCastExpr::classof
clang::CXXReinterpretCastExpr::Create
clang::CXXReinterpretCastExpr::CreateEmpty
clang::CXXReinterpretCastExpr::classof
clang::CXXConstCastExpr::Create
clang::CXXConstCastExpr::CreateEmpty
clang::CXXConstCastExpr::classof
clang::UserDefinedLiteral::UDSuffixLoc
clang::UserDefinedLiteral::Create
clang::UserDefinedLiteral::CreateEmpty
clang::UserDefinedLiteral::LiteralOperatorKind
clang::UserDefinedLiteral::getLiteralOperatorKind
clang::UserDefinedLiteral::getCookedLiteral
clang::UserDefinedLiteral::getCookedLiteral
clang::UserDefinedLiteral::getBeginLoc
clang::UserDefinedLiteral::getEndLoc
clang::UserDefinedLiteral::getUDSuffixLoc
clang::UserDefinedLiteral::getUDSuffix
clang::UserDefinedLiteral::classof
clang::CXXBoolLiteralExpr::getValue
clang::CXXBoolLiteralExpr::setValue
clang::CXXBoolLiteralExpr::getBeginLoc
clang::CXXBoolLiteralExpr::getEndLoc
clang::CXXBoolLiteralExpr::getLocation
clang::CXXBoolLiteralExpr::setLocation
clang::CXXBoolLiteralExpr::classof
clang::CXXBoolLiteralExpr::children
clang::CXXNullPtrLiteralExpr::getBeginLoc
clang::CXXNullPtrLiteralExpr::getEndLoc
clang::CXXNullPtrLiteralExpr::getLocation
clang::CXXNullPtrLiteralExpr::setLocation
clang::CXXNullPtrLiteralExpr::classof
clang::CXXNullPtrLiteralExpr::children
clang::CXXStdInitializerListExpr::SubExpr
clang::CXXStdInitializerListExpr::getSubExpr
clang::CXXStdInitializerListExpr::getSubExpr
clang::CXXStdInitializerListExpr::getBeginLoc
clang::CXXTypeidExpr::Operand
clang::CXXTypeidExpr::Range
clang::CXXTypeidExpr::isPotentiallyEvaluated
clang::CXXTypeidExpr::isTypeOperand
clang::CXXTypeidExpr::getTypeOperand
clang::CXXTypeidExpr::getTypeOperandSourceInfo
clang::CXXTypeidExpr::setTypeOperandSourceInfo
clang::CXXTypeidExpr::getExprOperand
clang::CXXTypeidExpr::setExprOperand
clang::CXXTypeidExpr::getBeginLoc
clang::MSPropertyRefExpr::BaseExpr
clang::MSPropertyRefExpr::TheDecl
clang::MSPropertyRefExpr::MemberLoc
clang::MSPropertyRefExpr::IsArrow
clang::MSPropertyRefExpr::QualifierLoc
clang::MSPropertyRefExpr::getSourceRange
clang::MSPropertySubscriptExpr::SubExprs
clang::MSPropertySubscriptExpr::RBracketLoc
clang::MSPropertySubscriptExpr::setBase
clang::MSPropertySubscriptExpr::setIdx
clang::MSPropertySubscriptExpr::getBase
clang::MSPropertySubscriptExpr::getBase
clang::MSPropertySubscriptExpr::getIdx
clang::MSPropertySubscriptExpr::getIdx
clang::MSPropertySubscriptExpr::getBeginLoc
clang::CXXUuidofExpr::Operand
clang::CXXUuidofExpr::UuidStr
clang::CXXUuidofExpr::Range
clang::CXXUuidofExpr::isTypeOperand
clang::CXXUuidofExpr::getTypeOperand
clang::CXXUuidofExpr::getTypeOperandSourceInfo
clang::CXXUuidofExpr::setTypeOperandSourceInfo
clang::CXXUuidofExpr::getExprOperand
clang::CXXUuidofExpr::setExprOperand
clang::CXXUuidofExpr::setUuidStr
clang::CXXUuidofExpr::getUuidStr
clang::CXXUuidofExpr::getBeginLoc
clang::CXXThisExpr::getLocation
clang::CXXThisExpr::setLocation
clang::CXXThisExpr::getBeginLoc
clang::CXXThisExpr::getEndLoc
clang::CXXThisExpr::isImplicit
clang::CXXThisExpr::setImplicit
clang::CXXThisExpr::classof
clang::CXXThisExpr::children
clang::CXXThrowExpr::Operand
clang::CXXThrowExpr::getSubExpr
clang::CXXThrowExpr::getSubExpr
clang::CXXThrowExpr::getThrowLoc
clang::CXXThrowExpr::isThrownVariableInScope
clang::CXXThrowExpr::getBeginLoc
clang::CXXThrowExpr::getEndLoc
clang::CXXDefaultArgExpr::Param
clang::CXXDefaultArgExpr::Create
clang::CXXDefaultArgExpr::getParam
clang::CXXDefaultArgExpr::getParam
clang::CXXDefaultArgExpr::getExpr
clang::CXXDefaultArgExpr::getExpr
clang::CXXDefaultArgExpr::getUsedLocation
clang::CXXDefaultArgExpr::getBeginLoc
clang::CXXDefaultArgExpr::getEndLoc
clang::CXXDefaultArgExpr::getExprLoc
clang::CXXDefaultArgExpr::classof
clang::CXXDefaultArgExpr::children
clang::CXXDefaultInitExpr::Field
clang::CXXDefaultInitExpr::Create
clang::CXXDefaultInitExpr::getField
clang::CXXDefaultInitExpr::getField
clang::CXXDefaultInitExpr::getExpr
clang::CXXDefaultInitExpr::getExpr
clang::CXXDefaultInitExpr::getBeginLoc
clang::CXXDefaultInitExpr::getEndLoc
clang::CXXDefaultInitExpr::classof
clang::CXXDefaultInitExpr::children
clang::CXXTemporary::Destructor
clang::CXXTemporary::Create
clang::CXXTemporary::getDestructor
clang::CXXTemporary::setDestructor
clang::CXXBindTemporaryExpr::Temp
clang::CXXBindTemporaryExpr::SubExpr
clang::CXXBindTemporaryExpr::Create
clang::CXXBindTemporaryExpr::getTemporary
clang::CXXBindTemporaryExpr::getTemporary
clang::CXXBindTemporaryExpr::setTemporary
clang::CXXBindTemporaryExpr::getSubExpr
clang::CXXBindTemporaryExpr::getSubExpr
clang::CXXBindTemporaryExpr::setSubExpr
clang::CXXBindTemporaryExpr::getBeginLoc
clang::CXXConstructExpr::ConstructionKind
clang::CXXConstructExpr::Constructor
clang::CXXConstructExpr::ParenOrBraceRange
clang::CXXConstructExpr::NumArgs
clang::CXXConstructExpr::getTrailingArgs
clang::CXXConstructExpr::getTrailingArgs
clang::CXXConstructExpr::sizeOfTrailingObjects
clang::CXXConstructExpr::Create
clang::CXXConstructExpr::CreateEmpty
clang::CXXConstructExpr::getConstructor
clang::CXXConstructExpr::getLocation
clang::CXXConstructExpr::setLocation
clang::CXXConstructExpr::isElidable
clang::CXXConstructExpr::setElidable
clang::CXXConstructExpr::hadMultipleCandidates
clang::CXXConstructExpr::setHadMultipleCandidates
clang::CXXConstructExpr::isListInitialization
clang::CXXConstructExpr::setListInitialization
clang::CXXConstructExpr::isStdInitListInitialization
clang::CXXConstructExpr::setStdInitListInitialization
clang::CXXConstructExpr::requiresZeroInitialization
clang::CXXConstructExpr::setRequiresZeroInitialization
clang::CXXConstructExpr::getConstructionKind
clang::CXXConstructExpr::setConstructionKind
clang::CXXConstructExpr::arguments
clang::CXXConstructExpr::arguments
clang::CXXConstructExpr::arg_begin
clang::CXXConstructExpr::arg_end
clang::CXXConstructExpr::arg_begin
clang::CXXConstructExpr::arg_end
clang::CXXConstructExpr::getArgs
clang::CXXConstructExpr::getArgs
clang::CXXConstructExpr::getNumArgs
clang::CXXConstructExpr::getArg
clang::CXXConstructExpr::getArg
clang::CXXConstructExpr::setArg
clang::CXXConstructExpr::getBeginLoc
clang::CXXConstructExpr::getEndLoc
clang::CXXConstructExpr::getParenOrBraceRange
clang::CXXConstructExpr::setParenOrBraceRange
clang::CXXConstructExpr::classof
clang::CXXConstructExpr::children
clang::CXXInheritedCtorInitExpr::Constructor
clang::CXXInheritedCtorInitExpr::Loc
clang::CXXInheritedCtorInitExpr::ConstructsVirtualBase
clang::CXXInheritedCtorInitExpr::InheritedFromVirtualBase
clang::CXXInheritedCtorInitExpr::getConstructor
clang::CXXInheritedCtorInitExpr::constructsVBase
clang::CXXInheritedCtorInitExpr::getConstructionKind
clang::CXXInheritedCtorInitExpr::inheritedFromVBase
clang::CXXInheritedCtorInitExpr::getLocation
clang::CXXFunctionalCastExpr::LParenLoc
clang::CXXFunctionalCastExpr::RParenLoc
clang::CXXFunctionalCastExpr::Create
clang::CXXFunctionalCastExpr::CreateEmpty
clang::CXXFunctionalCastExpr::getLParenLoc
clang::CXXFunctionalCastExpr::setLParenLoc
clang::CXXFunctionalCastExpr::getRParenLoc
clang::CXXFunctionalCastExpr::setRParenLoc
clang::CXXFunctionalCastExpr::isListInitialization
clang::CXXFunctionalCastExpr::getBeginLoc
clang::CXXFunctionalCastExpr::getEndLoc
clang::CXXFunctionalCastExpr::classof
clang::CXXTemporaryObjectExpr::TSI
clang::CXXTemporaryObjectExpr::Create
clang::CXXTemporaryObjectExpr::CreateEmpty
clang::CXXTemporaryObjectExpr::getTypeSourceInfo
clang::CXXTemporaryObjectExpr::getBeginLoc
clang::CXXTemporaryObjectExpr::getEndLoc
clang::CXXTemporaryObjectExpr::classof
clang::CXXConstructExpr::getTrailingArgs
clang::LambdaExpr::IntroducerRange
clang::LambdaExpr::CaptureDefaultLoc
clang::LambdaExpr::NumCaptures
clang::LambdaExpr::CaptureDefault
clang::LambdaExpr::ExplicitParams
clang::LambdaExpr::ExplicitResultType
clang::LambdaExpr::ClosingBrace
clang::LambdaExpr::getStoredStmts
clang::LambdaExpr::getStoredStmts
clang::LambdaExpr::Create
clang::LambdaExpr::CreateDeserialized
clang::LambdaExpr::getCaptureDefault
clang::LambdaExpr::getCaptureDefaultLoc
clang::LambdaExpr::isInitCapture
clang::LambdaExpr::captures
clang::LambdaExpr::capture_begin
clang::LambdaExpr::capture_end
clang::LambdaExpr::capture_size
clang::LambdaExpr::explicit_captures
clang::LambdaExpr::explicit_capture_begin
clang::LambdaExpr::explicit_capture_end
clang::LambdaExpr::implicit_captures
clang::LambdaExpr::implicit_capture_begin
clang::LambdaExpr::implicit_capture_end
clang::LambdaExpr::capture_inits
clang::LambdaExpr::capture_inits
clang::LambdaExpr::capture_init_begin
clang::LambdaExpr::capture_init_begin
clang::LambdaExpr::capture_init_end
clang::LambdaExpr::capture_init_end
clang::LambdaExpr::getIntroducerRange
clang::LambdaExpr::getLambdaClass
clang::LambdaExpr::getCallOperator
clang::LambdaExpr::getTemplateParameterList
clang::LambdaExpr::isGenericLambda
clang::LambdaExpr::getBody
clang::LambdaExpr::isMutable
clang::LambdaExpr::hasExplicitParameters
clang::LambdaExpr::hasExplicitResultType
clang::LambdaExpr::classof
clang::LambdaExpr::getBeginLoc
clang::CXXScalarValueInitExpr::TypeInfo
clang::CXXScalarValueInitExpr::getTypeSourceInfo
clang::CXXScalarValueInitExpr::getRParenLoc
clang::CXXScalarValueInitExpr::getBeginLoc
clang::CXXScalarValueInitExpr::getEndLoc
clang::CXXScalarValueInitExpr::classof
clang::CXXScalarValueInitExpr::children
clang::CXXNewExpr::OperatorNew
clang::CXXNewExpr::OperatorDelete
clang::CXXNewExpr::AllocatedTypeInfo
clang::CXXNewExpr::Range
clang::CXXNewExpr::DirectInitRange
clang::CXXNewExpr::arraySizeOffset
clang::CXXNewExpr::initExprOffset
clang::CXXNewExpr::placementNewArgsOffset
clang::CXXNewExpr::numTrailingObjects
clang::CXXNewExpr::InitializationStyle
clang::CXXNewExpr::Create
clang::CXXNewExpr::CreateEmpty
clang::CXXNewExpr::getAllocatedType
clang::CXXNewExpr::getAllocatedTypeSourceInfo
clang::CXXNewExpr::shouldNullCheckAllocation
clang::CXXNewExpr::getOperatorNew
clang::CXXNewExpr::setOperatorNew
clang::CXXNewExpr::getOperatorDelete
clang::CXXNewExpr::setOperatorDelete
clang::CXXNewExpr::isArray
clang::CXXNewExpr::getArraySize
clang::CXXNewExpr::getArraySize
clang::CXXNewExpr::getNumPlacementArgs
clang::CXXNewExpr::getPlacementArgs
clang::CXXNewExpr::getPlacementArg
clang::CXXNewExpr::getPlacementArg
clang::CXXNewExpr::isParenTypeId
clang::CXXNewExpr::getTypeIdParens
clang::CXXNewExpr::isGlobalNew
clang::CXXNewExpr::hasInitializer
clang::CXXNewExpr::getInitializationStyle
clang::CXXNewExpr::getInitializer
clang::CXXNewExpr::getInitializer
clang::CXXNewExpr::getConstructExpr
clang::CXXNewExpr::passAlignment
clang::CXXNewExpr::doesUsualArrayDeleteWantSize
clang::CXXNewExpr::placement_arguments
clang::CXXNewExpr::placement_arguments
clang::CXXNewExpr::placement_arg_begin
clang::CXXNewExpr::placement_arg_end
clang::CXXNewExpr::placement_arg_begin
clang::CXXNewExpr::placement_arg_end
clang::CXXNewExpr::raw_arg_begin
clang::CXXNewExpr::raw_arg_end
clang::CXXNewExpr::raw_arg_begin
clang::CXXNewExpr::raw_arg_end
clang::CXXNewExpr::getBeginLoc
clang::CXXNewExpr::getEndLoc
clang::CXXNewExpr::getDirectInitRange
clang::CXXNewExpr::getSourceRange
clang::CXXNewExpr::classof
clang::CXXNewExpr::children
clang::CXXDeleteExpr::OperatorDelete
clang::CXXDeleteExpr::Argument
clang::CXXDeleteExpr::isGlobalDelete
clang::CXXDeleteExpr::isArrayForm
clang::CXXDeleteExpr::isArrayFormAsWritten
clang::CXXDeleteExpr::doesUsualArrayDeleteWantSize
clang::CXXDeleteExpr::getOperatorDelete
clang::CXXDeleteExpr::getArgument
clang::CXXDeleteExpr::getArgument
clang::CXXDeleteExpr::getDestroyedType
clang::CXXDeleteExpr::getBeginLoc
clang::CXXDeleteExpr::getEndLoc
clang::PseudoDestructorTypeStorage::Type
clang::PseudoDestructorTypeStorage::Location
clang::PseudoDestructorTypeStorage::getTypeSourceInfo
clang::PseudoDestructorTypeStorage::getIdentifier
clang::PseudoDestructorTypeStorage::getLocation
clang::CXXPseudoDestructorExpr::Base
clang::CXXPseudoDestructorExpr::IsArrow
clang::CXXPseudoDestructorExpr::OperatorLoc
clang::CXXPseudoDestructorExpr::QualifierLoc
clang::CXXPseudoDestructorExpr::ScopeType
clang::CXXPseudoDestructorExpr::ColonColonLoc
clang::CXXPseudoDestructorExpr::TildeLoc
clang::CXXPseudoDestructorExpr::DestroyedType
clang::CXXPseudoDestructorExpr::getBase
clang::CXXPseudoDestructorExpr::hasQualifier
clang::CXXPseudoDestructorExpr::getQualifierLoc
clang::CXXPseudoDestructorExpr::getQualifier
clang::CXXPseudoDestructorExpr::isArrow
clang::CXXPseudoDestructorExpr::getOperatorLoc
clang::CXXPseudoDestructorExpr::getScopeTypeInfo
clang::CXXPseudoDestructorExpr::getColonColonLoc
clang::CXXPseudoDestructorExpr::getTildeLoc
clang::CXXPseudoDestructorExpr::getDestroyedTypeInfo
clang::CXXPseudoDestructorExpr::getDestroyedTypeIdentifier
clang::CXXPseudoDestructorExpr::getDestroyedType
clang::CXXPseudoDestructorExpr::getDestroyedTypeLoc
clang::CXXPseudoDestructorExpr::setDestroyedType
clang::CXXPseudoDestructorExpr::setDestroyedType
clang::CXXPseudoDestructorExpr::getBeginLoc
clang::CXXPseudoDestructorExpr::classof
clang::CXXPseudoDestructorExpr::children
clang::TypeTraitExpr::Loc
clang::TypeTraitExpr::RParenLoc
clang::TypeTraitExpr::numTrailingObjects
clang::TypeTraitExpr::Create
clang::TypeTraitExpr::CreateDeserialized
clang::TypeTraitExpr::getTrait
clang::TypeTraitExpr::getValue
clang::TypeTraitExpr::getNumArgs
clang::TypeTraitExpr::getArg
clang::TypeTraitExpr::getArgs
clang::TypeTraitExpr::getBeginLoc
clang::ArrayTypeTraitExpr::ATT
clang::ArrayTypeTraitExpr::Value
clang::ArrayTypeTraitExpr::Dimension
clang::ArrayTypeTraitExpr::Loc
clang::ArrayTypeTraitExpr::RParen
clang::ArrayTypeTraitExpr::QueriedType
clang::ArrayTypeTraitExpr::getBeginLoc
clang::ExpressionTraitExpr::ET
clang::ExpressionTraitExpr::Value
clang::ExpressionTraitExpr::Loc
clang::ExpressionTraitExpr::RParen
clang::ExpressionTraitExpr::QueriedExpression
clang::ExpressionTraitExpr::getBeginLoc
clang::OverloadExpr::NameInfo
clang::OverloadExpr::QualifierLoc
clang::OverloadExpr::getTrailingResults
clang::OverloadExpr::getTrailingResults
clang::OverloadExpr::getTrailingASTTemplateKWAndArgsInfo
clang::OverloadExpr::getTrailingASTTemplateKWAndArgsInfo
clang::OverloadExpr::getTrailingTemplateArgumentLoc
clang::OverloadExpr::getTrailingTemplateArgumentLoc
clang::OverloadExpr::hasTemplateKWAndArgsInfo
clang::OverloadExpr::FindResult
clang::OverloadExpr::FindResult::Expression
clang::OverloadExpr::FindResult::IsAddressOfOperand
clang::OverloadExpr::FindResult::HasFormOfMemberPointer
clang::OverloadExpr::find
clang::OverloadExpr::getNamingClass
clang::OverloadExpr::getNamingClass
clang::OverloadExpr::decls_begin
clang::OverloadExpr::decls_end
clang::OverloadExpr::decls
clang::OverloadExpr::getNumDecls
clang::OverloadExpr::getNameInfo
clang::OverloadExpr::getName
clang::OverloadExpr::getNameLoc
clang::OverloadExpr::getQualifier
clang::OverloadExpr::getQualifierLoc
clang::OverloadExpr::getTemplateKeywordLoc
clang::OverloadExpr::getLAngleLoc
clang::OverloadExpr::getRAngleLoc
clang::OverloadExpr::hasTemplateKeyword
clang::OverloadExpr::hasExplicitTemplateArgs
clang::OverloadExpr::getTemplateArgs
clang::OverloadExpr::getNumTemplateArgs
clang::OverloadExpr::template_arguments
clang::OverloadExpr::copyTemplateArgumentsInto
clang::OverloadExpr::classof
clang::UnresolvedLookupExpr::NamingClass
clang::UnresolvedLookupExpr::numTrailingObjects
clang::UnresolvedLookupExpr::Create
clang::UnresolvedLookupExpr::Create
clang::UnresolvedLookupExpr::CreateEmpty
clang::UnresolvedLookupExpr::requiresADL
clang::UnresolvedLookupExpr::isOverloaded
clang::UnresolvedLookupExpr::getNamingClass
clang::UnresolvedLookupExpr::getNamingClass
clang::UnresolvedLookupExpr::getBeginLoc
clang::DependentScopeDeclRefExpr::QualifierLoc
clang::DependentScopeDeclRefExpr::NameInfo
clang::DependentScopeDeclRefExpr::numTrailingObjects
clang::DependentScopeDeclRefExpr::hasTemplateKWAndArgsInfo
clang::DependentScopeDeclRefExpr::Create
clang::DependentScopeDeclRefExpr::CreateEmpty
clang::DependentScopeDeclRefExpr::getNameInfo
clang::DependentScopeDeclRefExpr::getDeclName
clang::DependentScopeDeclRefExpr::getLocation
clang::DependentScopeDeclRefExpr::getQualifierLoc
clang::DependentScopeDeclRefExpr::getQualifier
clang::DependentScopeDeclRefExpr::getTemplateKeywordLoc
clang::DependentScopeDeclRefExpr::getLAngleLoc
clang::DependentScopeDeclRefExpr::getRAngleLoc
clang::DependentScopeDeclRefExpr::hasTemplateKeyword
clang::DependentScopeDeclRefExpr::hasExplicitTemplateArgs
clang::DependentScopeDeclRefExpr::copyTemplateArgumentsInto
clang::DependentScopeDeclRefExpr::getTemplateArgs
clang::DependentScopeDeclRefExpr::getNumTemplateArgs
clang::DependentScopeDeclRefExpr::template_arguments
clang::DependentScopeDeclRefExpr::getBeginLoc
clang::ExprWithCleanups::Create
clang::ExprWithCleanups::Create
clang::ExprWithCleanups::getObjects
clang::ExprWithCleanups::getNumObjects
clang::ExprWithCleanups::getObject
clang::ExprWithCleanups::cleanupsHaveSideEffects
clang::ExprWithCleanups::getBeginLoc
clang::CXXUnresolvedConstructExpr::TSI
clang::CXXUnresolvedConstructExpr::LParenLoc
clang::CXXUnresolvedConstructExpr::RParenLoc
clang::CXXUnresolvedConstructExpr::Create
clang::CXXUnresolvedConstructExpr::CreateEmpty
clang::CXXUnresolvedConstructExpr::getTypeAsWritten
clang::CXXUnresolvedConstructExpr::getTypeSourceInfo
clang::CXXUnresolvedConstructExpr::getLParenLoc
clang::CXXUnresolvedConstructExpr::setLParenLoc
clang::CXXUnresolvedConstructExpr::getRParenLoc
clang::CXXUnresolvedConstructExpr::setRParenLoc
clang::CXXUnresolvedConstructExpr::isListInitialization
clang::CXXUnresolvedConstructExpr::arg_size
clang::CXXUnresolvedConstructExpr::arg_begin
clang::CXXUnresolvedConstructExpr::arg_end
clang::CXXUnresolvedConstructExpr::arguments
clang::CXXUnresolvedConstructExpr::arg_begin
clang::CXXUnresolvedConstructExpr::arg_end
clang::CXXUnresolvedConstructExpr::arguments
clang::CXXUnresolvedConstructExpr::getArg
clang::CXXUnresolvedConstructExpr::getArg
clang::CXXUnresolvedConstructExpr::setArg
clang::CXXUnresolvedConstructExpr::getBeginLoc
clang::CXXUnresolvedConstructExpr::getEndLoc
clang::CXXDependentScopeMemberExpr::Base
clang::CXXDependentScopeMemberExpr::BaseType
clang::CXXDependentScopeMemberExpr::QualifierLoc
clang::CXXDependentScopeMemberExpr::MemberNameInfo
clang::CXXDependentScopeMemberExpr::hasTemplateKWAndArgsInfo
clang::CXXDependentScopeMemberExpr::hasFirstQualifierFoundInScope
clang::CXXDependentScopeMemberExpr::numTrailingObjects
clang::CXXDependentScopeMemberExpr::Create
clang::CXXDependentScopeMemberExpr::CreateEmpty
clang::CXXDependentScopeMemberExpr::isImplicitAccess
clang::CXXDependentScopeMemberExpr::getBase
clang::CXXDependentScopeMemberExpr::getBaseType
clang::CXXDependentScopeMemberExpr::isArrow
clang::CXXDependentScopeMemberExpr::getOperatorLoc
clang::CXXDependentScopeMemberExpr::getQualifier
clang::CXXDependentScopeMemberExpr::getQualifierLoc
clang::CXXDependentScopeMemberExpr::getFirstQualifierFoundInScope
clang::CXXDependentScopeMemberExpr::getMemberNameInfo
clang::CXXDependentScopeMemberExpr::getMember
clang::CXXDependentScopeMemberExpr::getMemberLoc
clang::CXXDependentScopeMemberExpr::getTemplateKeywordLoc
clang::CXXDependentScopeMemberExpr::getLAngleLoc
clang::CXXDependentScopeMemberExpr::getRAngleLoc
clang::CXXDependentScopeMemberExpr::hasTemplateKeyword
clang::CXXDependentScopeMemberExpr::hasExplicitTemplateArgs
clang::CXXDependentScopeMemberExpr::copyTemplateArgumentsInto
clang::CXXDependentScopeMemberExpr::getTemplateArgs
clang::CXXDependentScopeMemberExpr::getNumTemplateArgs
clang::CXXDependentScopeMemberExpr::template_arguments
clang::CXXDependentScopeMemberExpr::getBeginLoc
clang::UnresolvedMemberExpr::Base
clang::UnresolvedMemberExpr::BaseType
clang::UnresolvedMemberExpr::OperatorLoc
clang::UnresolvedMemberExpr::numTrailingObjects
clang::UnresolvedMemberExpr::Create
clang::UnresolvedMemberExpr::CreateEmpty
clang::UnresolvedMemberExpr::isImplicitAccess
clang::UnresolvedMemberExpr::getBase
clang::UnresolvedMemberExpr::getBase
clang::UnresolvedMemberExpr::getBaseType
clang::UnresolvedMemberExpr::hasUnresolvedUsing
clang::UnresolvedMemberExpr::isArrow
clang::UnresolvedMemberExpr::getOperatorLoc
clang::UnresolvedMemberExpr::getNamingClass
clang::UnresolvedMemberExpr::getNamingClass
clang::UnresolvedMemberExpr::getMemberNameInfo
clang::UnresolvedMemberExpr::getMemberName
clang::UnresolvedMemberExpr::getMemberLoc
clang::UnresolvedMemberExpr::getExprLoc
clang::OverloadExpr::getTrailingResults
clang::OverloadExpr::getTrailingASTTemplateKWAndArgsInfo
clang::OverloadExpr::getTrailingTemplateArgumentLoc
clang::OverloadExpr::getNamingClass
clang::CXXNoexceptExpr::Operand
clang::CXXNoexceptExpr::Range
clang::CXXNoexceptExpr::getOperand
clang::CXXNoexceptExpr::getBeginLoc
clang::CXXNoexceptExpr::getEndLoc
clang::CXXNoexceptExpr::getSourceRange
clang::CXXNoexceptExpr::getValue
clang::CXXNoexceptExpr::classof
clang::CXXNoexceptExpr::children
clang::PackExpansionExpr::EllipsisLoc
clang::PackExpansionExpr::NumExpansions
clang::PackExpansionExpr::Pattern
clang::PackExpansionExpr::getPattern
clang::PackExpansionExpr::getPattern
clang::PackExpansionExpr::getEllipsisLoc
clang::PackExpansionExpr::getNumExpansions
clang::PackExpansionExpr::getBeginLoc
clang::SizeOfPackExpr::OperatorLoc
clang::SizeOfPackExpr::PackLoc
clang::SizeOfPackExpr::RParenLoc
clang::SizeOfPackExpr::Length
clang::SizeOfPackExpr::Pack
clang::SizeOfPackExpr::Create
clang::SizeOfPackExpr::CreateDeserialized
clang::SizeOfPackExpr::getOperatorLoc
clang::SizeOfPackExpr::getPackLoc
clang::SizeOfPackExpr::getRParenLoc
clang::SizeOfPackExpr::getPack
clang::SizeOfPackExpr::getPackLength
clang::SizeOfPackExpr::isPartiallySubstituted
clang::SizeOfPackExpr::getPartialArguments
clang::SizeOfPackExpr::getBeginLoc
clang::SubstNonTypeTemplateParmExpr::Param
clang::SubstNonTypeTemplateParmExpr::Replacement
clang::SubstNonTypeTemplateParmExpr::getNameLoc
clang::SubstNonTypeTemplateParmExpr::getBeginLoc
clang::SubstNonTypeTemplateParmExpr::getEndLoc
clang::SubstNonTypeTemplateParmExpr::getReplacement
clang::SubstNonTypeTemplateParmExpr::getParameter
clang::SubstNonTypeTemplateParmExpr::classof
clang::SubstNonTypeTemplateParmExpr::children
clang::SubstNonTypeTemplateParmPackExpr::Param
clang::SubstNonTypeTemplateParmPackExpr::Arguments
clang::SubstNonTypeTemplateParmPackExpr::NumArguments
clang::SubstNonTypeTemplateParmPackExpr::NameLoc
clang::SubstNonTypeTemplateParmPackExpr::getParameterPack
clang::SubstNonTypeTemplateParmPackExpr::getParameterPackLocation
clang::SubstNonTypeTemplateParmPackExpr::getArgumentPack
clang::SubstNonTypeTemplateParmPackExpr::getBeginLoc
clang::FunctionParmPackExpr::ParamPack
clang::FunctionParmPackExpr::NameLoc
clang::FunctionParmPackExpr::NumParameters
clang::FunctionParmPackExpr::Create
clang::FunctionParmPackExpr::CreateEmpty
clang::FunctionParmPackExpr::getParameterPack
clang::FunctionParmPackExpr::getParameterPackLocation
clang::FunctionParmPackExpr::begin
clang::FunctionParmPackExpr::end
clang::FunctionParmPackExpr::getNumExpansions
clang::FunctionParmPackExpr::getExpansion
clang::FunctionParmPackExpr::getBeginLoc
clang::MaterializeTemporaryExpr::ExtraState
clang::MaterializeTemporaryExpr::ExtraState::Temporary
clang::MaterializeTemporaryExpr::ExtraState::ExtendingDecl
clang::MaterializeTemporaryExpr::ExtraState::ManglingNumber
clang::MaterializeTemporaryExpr::State
clang::MaterializeTemporaryExpr::initializeExtraState
clang::MaterializeTemporaryExpr::getTemporary
clang::MaterializeTemporaryExpr::GetTemporaryExpr
clang::MaterializeTemporaryExpr::getStorageDuration
clang::MaterializeTemporaryExpr::getExtendingDecl
clang::MaterializeTemporaryExpr::setExtendingDecl
clang::MaterializeTemporaryExpr::getManglingNumber
clang::MaterializeTemporaryExpr::isBoundToLvalueReference
clang::MaterializeTemporaryExpr::getBeginLoc
clang::CXXFoldExpr::LParenLoc
clang::CXXFoldExpr::EllipsisLoc
clang::CXXFoldExpr::RParenLoc
clang::CXXFoldExpr::SubExprs
clang::CXXFoldExpr::Opcode
clang::CXXFoldExpr::getLHS
clang::CXXFoldExpr::getRHS
clang::CXXFoldExpr::isRightFold
clang::CXXFoldExpr::isLeftFold
clang::CXXFoldExpr::getPattern
clang::CXXFoldExpr::getInit
clang::CXXFoldExpr::getEllipsisLoc
clang::CXXFoldExpr::getOperator
clang::CXXFoldExpr::getBeginLoc
clang::CoroutineSuspendExpr::KeywordLoc
clang::CoroutineSuspendExpr::SubExpr
clang::CoroutineSuspendExpr::SubExprs
clang::CoroutineSuspendExpr::OpaqueValue
clang::CoroutineSuspendExpr::getKeywordLoc
clang::CoroutineSuspendExpr::getCommonExpr
clang::CoroutineSuspendExpr::getOpaqueValue
clang::CoroutineSuspendExpr::getReadyExpr
clang::CoroutineSuspendExpr::getSuspendExpr
clang::CoroutineSuspendExpr::getResumeExpr
clang::CoroutineSuspendExpr::getBeginLoc
clang::CoawaitExpr::getOperand
clang::CoawaitExpr::isImplicit
clang::CoawaitExpr::setIsImplicit
clang::CoawaitExpr::classof
clang::DependentCoawaitExpr::KeywordLoc
clang::DependentCoawaitExpr::SubExprs
clang::DependentCoawaitExpr::getOperand
clang::DependentCoawaitExpr::getOperatorCoawaitLookup
clang::DependentCoawaitExpr::getKeywordLoc
clang::DependentCoawaitExpr::getBeginLoc
clang::CoyieldExpr::getOperand
clang::CoyieldExpr::classof