blob: 589161bfab8633923d5e79c9add36d81e5539cc5 [file] [log] [blame]
Reid Spencer5f016e22007-07-11 17:01:13 +00001//===--- Sema.h - Semantic Analysis & AST Building --------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file was developed by Chris Lattner and is distributed under
6// the University of Illinois Open Source License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file defines the Sema class, which performs semantic analysis and
11// builds ASTs.
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_CLANG_AST_SEMA_H
16#define LLVM_CLANG_AST_SEMA_H
17
18#include "clang/Parse/Action.h"
19#include "llvm/ADT/DenseMap.h"
Anders Carlssonc1fcb772007-07-22 07:07:56 +000020#include "llvm/ADT/SmallVector.h"
Reid Spencer5f016e22007-07-11 17:01:13 +000021#include <vector>
22#include <string>
23
24namespace clang {
25 class ASTContext;
26 class Preprocessor;
27 class Decl;
28 class Expr;
29 class VarDecl;
30 class ParmVarDecl;
31 class TypedefDecl;
32 class FunctionDecl;
33 class QualType;
34 class LangOptions;
35 class DeclaratorChunk;
Chris Lattnerd2177732007-07-20 16:59:19 +000036 class Token;
Reid Spencer5f016e22007-07-11 17:01:13 +000037 class IntegerLiteral;
38 class ArrayType;
39 class LabelStmt;
Anders Carlssonc1fcb772007-07-22 07:07:56 +000040 class SwitchStmt;
Steve Naroffe1b31fe2007-07-27 22:15:19 +000041 class OCUVectorType;
Reid Spencer5f016e22007-07-11 17:01:13 +000042
43/// Sema - This implements semantic analysis and AST building for C.
44class Sema : public Action {
45 Preprocessor &PP;
46
47 ASTContext &Context;
48
49 /// CurFunctionDecl - If inside of a function body, this contains a pointer to
50 /// the function decl for the function being parsed.
51 FunctionDecl *CurFunctionDecl;
52
53 /// LastInGroupList - This vector is populated when there are multiple
54 /// declarators in a single decl group (e.g. "int A, B, C"). In this case,
55 /// all but the last decl will be entered into this. This is used by the
56 /// ASTStreamer.
57 std::vector<Decl*> &LastInGroupList;
58
59 /// LabelMap - This is a mapping from label identifiers to the LabelStmt for
60 /// it (which acts like the label decl in some ways). Forward referenced
61 /// labels have a LabelStmt created for them with a null location & SubStmt.
62 llvm::DenseMap<IdentifierInfo*, LabelStmt*> LabelMap;
Anders Carlssonc1fcb772007-07-22 07:07:56 +000063
64 llvm::SmallVector<SwitchStmt*, 8> SwitchStack;
Reid Spencer5f016e22007-07-11 17:01:13 +000065public:
66 Sema(Preprocessor &pp, ASTContext &ctxt, std::vector<Decl*> &prevInGroup);
67
68 const LangOptions &getLangOptions() const;
69
70 /// The primitive diagnostic helpers - always returns true, which simplifies
71 /// error handling (i.e. less code).
72 bool Diag(SourceLocation Loc, unsigned DiagID);
73 bool Diag(SourceLocation Loc, unsigned DiagID, const std::string &Msg);
74 bool Diag(SourceLocation Loc, unsigned DiagID, const std::string &Msg1,
75 const std::string &Msg2);
76
77 /// More expressive diagnostic helpers for expressions (say that 6 times:-)
78 bool Diag(SourceLocation Loc, unsigned DiagID, SourceRange R1);
79 bool Diag(SourceLocation Loc, unsigned DiagID,
80 SourceRange R1, SourceRange R2);
81 bool Diag(SourceLocation Loc, unsigned DiagID, const std::string &Msg,
82 SourceRange R1);
83 bool Diag(SourceLocation Loc, unsigned DiagID, const std::string &Msg,
84 SourceRange R1, SourceRange R2);
85 bool Diag(SourceLocation Loc, unsigned DiagID, const std::string &Msg1,
86 const std::string &Msg2, SourceRange R1);
87 bool Diag(SourceLocation Loc, unsigned DiagID,
88 const std::string &Msg1, const std::string &Msg2,
89 SourceRange R1, SourceRange R2);
90
91 //===--------------------------------------------------------------------===//
92 // Type Analysis / Processing: SemaType.cpp.
93 //
94 QualType GetTypeForDeclarator(Declarator &D, Scope *S);
95
96 virtual TypeResult ParseTypeName(Scope *S, Declarator &D);
97
98 virtual TypeResult ParseParamDeclaratorType(Scope *S, Declarator &D);
99private:
100 //===--------------------------------------------------------------------===//
101 // Symbol table / Decl tracking callbacks: SemaDecl.cpp.
102 //
103 virtual DeclTy *isTypeName(const IdentifierInfo &II, Scope *S) const;
104 virtual DeclTy *ParseDeclarator(Scope *S, Declarator &D, ExprTy *Init,
105 DeclTy *LastInGroup);
106 virtual DeclTy *FinalizeDeclaratorGroup(Scope *S, DeclTy *Group);
107
108 virtual DeclTy *ParseStartOfFunctionDef(Scope *S, Declarator &D);
109 virtual DeclTy *ParseFunctionDefBody(DeclTy *Decl, StmtTy *Body);
110 virtual void PopScope(SourceLocation Loc, Scope *S);
111
112 /// ParsedFreeStandingDeclSpec - This method is invoked when a declspec with
113 /// no declarator (e.g. "struct foo;") is parsed.
114 virtual DeclTy *ParsedFreeStandingDeclSpec(Scope *S, DeclSpec &DS);
115
116 virtual DeclTy *ParseTag(Scope *S, unsigned TagType, TagKind TK,
117 SourceLocation KWLoc, IdentifierInfo *Name,
118 SourceLocation NameLoc, AttributeList *Attr);
119 virtual DeclTy *ParseField(Scope *S, DeclTy *TagDecl,SourceLocation DeclStart,
120 Declarator &D, ExprTy *BitfieldWidth);
121 virtual void ParseRecordBody(SourceLocation RecLoc, DeclTy *TagDecl,
122 DeclTy **Fields, unsigned NumFields);
123 virtual DeclTy *ParseEnumConstant(Scope *S, DeclTy *EnumDecl,
124 DeclTy *LastEnumConstant,
125 SourceLocation IdLoc, IdentifierInfo *Id,
126 SourceLocation EqualLoc, ExprTy *Val);
127 virtual void ParseEnumBody(SourceLocation EnumLoc, DeclTy *EnumDecl,
128 DeclTy **Elements, unsigned NumElements);
129private:
130 /// Subroutines of ParseDeclarator()...
131 TypedefDecl *ParseTypedefDecl(Scope *S, Declarator &D, Decl *LastDeclarator);
132 TypedefDecl *MergeTypeDefDecl(TypedefDecl *New, Decl *Old);
133 FunctionDecl *MergeFunctionDecl(FunctionDecl *New, Decl *Old);
134 VarDecl *MergeVarDecl(VarDecl *New, Decl *Old);
135 /// AddTopLevelDecl - called after the decl has been fully processed.
136 /// Allows for bookkeeping and post-processing of each declaration.
137 void AddTopLevelDecl(Decl *current, Decl *last);
138
139 /// More parsing and symbol table subroutines...
140 ParmVarDecl *ParseParamDeclarator(DeclaratorChunk &FI, unsigned ArgNo,
141 Scope *FnBodyScope);
142 Decl *LookupScopedDecl(IdentifierInfo *II, unsigned NSI, SourceLocation IdLoc,
143 Scope *S);
144 Decl *LazilyCreateBuiltin(IdentifierInfo *II, unsigned ID, Scope *S);
145 Decl *ImplicitlyDefineFunction(SourceLocation Loc, IdentifierInfo &II,
146 Scope *S);
147 // Decl attributes - this routine is the top level dispatcher.
148 void HandleDeclAttributes(Decl *New, AttributeList *declspec_prefix,
149 AttributeList *declarator_postfix);
150 void HandleDeclAttribute(Decl *New, AttributeList *rawAttr);
151
152 // HandleVectorTypeAttribute - this attribute is only applicable to
153 // integral and float scalars, although arrays, pointers, and function
154 // return values are allowed in conjunction with this construct. Aggregates
155 // with this attribute are invalid, even if they are of the same size as a
156 // corresponding scalar.
157 // The raw attribute should contain precisely 1 argument, the vector size
158 // for the variable, measured in bytes. If curType and rawAttr are well
159 // formed, this routine will return a new vector type.
160 QualType HandleVectorTypeAttribute(QualType curType, AttributeList *rawAttr);
Steve Naroff73322922007-07-18 18:00:27 +0000161 QualType HandleOCUVectorTypeAttribute(QualType curType, AttributeList *rawAttr);
Reid Spencer5f016e22007-07-11 17:01:13 +0000162
163 //===--------------------------------------------------------------------===//
164 // Statement Parsing Callbacks: SemaStmt.cpp.
165public:
166 virtual StmtResult ParseExprStmt(ExprTy *Expr);
167
168 virtual StmtResult ParseNullStmt(SourceLocation SemiLoc);
169 virtual StmtResult ParseCompoundStmt(SourceLocation L, SourceLocation R,
170 StmtTy **Elts, unsigned NumElts);
171 virtual StmtResult ParseDeclStmt(DeclTy *Decl);
172 virtual StmtResult ParseCaseStmt(SourceLocation CaseLoc, ExprTy *LHSVal,
173 SourceLocation DotDotDotLoc, ExprTy *RHSVal,
174 SourceLocation ColonLoc, StmtTy *SubStmt);
175 virtual StmtResult ParseDefaultStmt(SourceLocation DefaultLoc,
Chris Lattner6c36be52007-07-18 02:28:47 +0000176 SourceLocation ColonLoc, StmtTy *SubStmt,
177 Scope *CurScope);
Reid Spencer5f016e22007-07-11 17:01:13 +0000178 virtual StmtResult ParseLabelStmt(SourceLocation IdentLoc, IdentifierInfo *II,
179 SourceLocation ColonLoc, StmtTy *SubStmt);
180 virtual StmtResult ParseIfStmt(SourceLocation IfLoc, ExprTy *CondVal,
181 StmtTy *ThenVal, SourceLocation ElseLoc,
182 StmtTy *ElseVal);
Anders Carlssonc1fcb772007-07-22 07:07:56 +0000183 virtual StmtResult StartSwitchStmt(ExprTy *Cond);
184 virtual StmtResult FinishSwitchStmt(SourceLocation SwitchLoc, StmtTy *Switch,
185 ExprTy *Body);
Reid Spencer5f016e22007-07-11 17:01:13 +0000186 virtual StmtResult ParseWhileStmt(SourceLocation WhileLoc, ExprTy *Cond,
187 StmtTy *Body);
188 virtual StmtResult ParseDoStmt(SourceLocation DoLoc, StmtTy *Body,
189 SourceLocation WhileLoc, ExprTy *Cond);
190
191 virtual StmtResult ParseForStmt(SourceLocation ForLoc,
192 SourceLocation LParenLoc,
193 StmtTy *First, ExprTy *Second, ExprTy *Third,
194 SourceLocation RParenLoc, StmtTy *Body);
195 virtual StmtResult ParseGotoStmt(SourceLocation GotoLoc,
196 SourceLocation LabelLoc,
197 IdentifierInfo *LabelII);
198 virtual StmtResult ParseIndirectGotoStmt(SourceLocation GotoLoc,
199 SourceLocation StarLoc,
200 ExprTy *DestExp);
201 virtual StmtResult ParseContinueStmt(SourceLocation ContinueLoc,
202 Scope *CurScope);
203 virtual StmtResult ParseBreakStmt(SourceLocation GotoLoc, Scope *CurScope);
204
205 virtual StmtResult ParseReturnStmt(SourceLocation ReturnLoc,
206 ExprTy *RetValExp);
207
208 //===--------------------------------------------------------------------===//
209 // Expression Parsing Callbacks: SemaExpr.cpp.
210
211 // Primary Expressions.
212 virtual ExprResult ParseIdentifierExpr(Scope *S, SourceLocation Loc,
213 IdentifierInfo &II,
214 bool HasTrailingLParen);
Anders Carlsson22742662007-07-21 05:21:51 +0000215 virtual ExprResult ParsePreDefinedExpr(SourceLocation Loc,
Reid Spencer5f016e22007-07-11 17:01:13 +0000216 tok::TokenKind Kind);
Chris Lattnerd2177732007-07-20 16:59:19 +0000217 virtual ExprResult ParseNumericConstant(const Token &);
218 virtual ExprResult ParseCharacterConstant(const Token &);
Reid Spencer5f016e22007-07-11 17:01:13 +0000219 virtual ExprResult ParseParenExpr(SourceLocation L, SourceLocation R,
220 ExprTy *Val);
221
222 /// ParseStringLiteral - The specified tokens were lexed as pasted string
223 /// fragments (e.g. "foo" "bar" L"baz").
Chris Lattnerd2177732007-07-20 16:59:19 +0000224 virtual ExprResult ParseStringLiteral(const Token *Toks, unsigned NumToks);
Reid Spencer5f016e22007-07-11 17:01:13 +0000225
226 // Binary/Unary Operators. 'Tok' is the token for the operator.
227 virtual ExprResult ParseUnaryOp(SourceLocation OpLoc, tok::TokenKind Op,
228 ExprTy *Input);
229 virtual ExprResult
230 ParseSizeOfAlignOfTypeExpr(SourceLocation OpLoc, bool isSizeof,
231 SourceLocation LParenLoc, TypeTy *Ty,
232 SourceLocation RParenLoc);
233
234 virtual ExprResult ParsePostfixUnaryOp(SourceLocation OpLoc,
235 tok::TokenKind Kind, ExprTy *Input);
236
237 virtual ExprResult ParseArraySubscriptExpr(ExprTy *Base, SourceLocation LLoc,
238 ExprTy *Idx, SourceLocation RLoc);
239 virtual ExprResult ParseMemberReferenceExpr(ExprTy *Base,SourceLocation OpLoc,
240 tok::TokenKind OpKind,
241 SourceLocation MemberLoc,
242 IdentifierInfo &Member);
243
244 /// ParseCallExpr - Handle a call to Fn with the specified array of arguments.
245 /// This provides the location of the left/right parens and a list of comma
246 /// locations.
247 virtual ExprResult ParseCallExpr(ExprTy *Fn, SourceLocation LParenLoc,
248 ExprTy **Args, unsigned NumArgs,
249 SourceLocation *CommaLocs,
250 SourceLocation RParenLoc);
251
252 virtual ExprResult ParseCastExpr(SourceLocation LParenLoc, TypeTy *Ty,
253 SourceLocation RParenLoc, ExprTy *Op);
Steve Naroff4aa88f82007-07-19 01:06:55 +0000254
255 virtual ExprResult ParseCompoundLiteral(SourceLocation LParenLoc, TypeTy *Ty,
256 SourceLocation RParenLoc, ExprTy *Op);
Reid Spencer5f016e22007-07-11 17:01:13 +0000257
Steve Naroff4aa88f82007-07-19 01:06:55 +0000258 virtual ExprResult ParseInitList(SourceLocation LParenLoc,
259 ExprTy **InitList, unsigned NumInit,
260 SourceLocation RParenLoc);
261
Reid Spencer5f016e22007-07-11 17:01:13 +0000262 virtual ExprResult ParseBinOp(SourceLocation TokLoc, tok::TokenKind Kind,
263 ExprTy *LHS,ExprTy *RHS);
264
265 /// ParseConditionalOp - Parse a ?: operation. Note that 'LHS' may be null
266 /// in the case of a the GNU conditional expr extension.
267 virtual ExprResult ParseConditionalOp(SourceLocation QuestionLoc,
268 SourceLocation ColonLoc,
269 ExprTy *Cond, ExprTy *LHS, ExprTy *RHS);
270
271 /// ParseAddrLabel - Parse the GNU address of label extension: "&&foo".
272 virtual ExprResult ParseAddrLabel(SourceLocation OpLoc, SourceLocation LabLoc,
273 IdentifierInfo *LabelII);
274
Chris Lattnerab18c4c2007-07-24 16:58:17 +0000275 virtual ExprResult ParseStmtExpr(SourceLocation LPLoc, StmtTy *SubStmt,
276 SourceLocation RPLoc); // "({..})"
277
Reid Spencer5f016e22007-07-11 17:01:13 +0000278 /// ParseCXXCasts - Parse {dynamic,static,reinterpret,const}_cast's.
279 virtual ExprResult ParseCXXCasts(SourceLocation OpLoc, tok::TokenKind Kind,
280 SourceLocation LAngleBracketLoc, TypeTy *Ty,
281 SourceLocation RAngleBracketLoc,
282 SourceLocation LParenLoc, ExprTy *E,
283 SourceLocation RParenLoc);
284
285 /// ParseCXXBoolLiteral - Parse {true,false} literals.
286 virtual ExprResult ParseCXXBoolLiteral(SourceLocation OpLoc,
287 tok::TokenKind Kind);
288private:
289 // UsualUnaryConversions - promotes integers (C99 6.3.1.1p2) and converts
Steve Naroffc80b4ee2007-07-16 21:54:35 +0000290 // functions and arrays to their respective pointers (C99 6.3.2.1).
291 void UsualUnaryConversions(Expr *&expr);
292
293 // DefaultFunctionArrayConversion - converts functions and arrays
294 // to their respective pointers (C99 6.3.2.1).
295 void DefaultFunctionArrayConversion(Expr *&expr);
Steve Naroff90045e82007-07-13 23:32:42 +0000296
Reid Spencer5f016e22007-07-11 17:01:13 +0000297 // UsualArithmeticConversions - performs the UsualUnaryConversions on it's
298 // operands and then handles various conversions that are common to binary
299 // operators (C99 6.3.1.8). If both operands aren't arithmetic, this
300 // routine returns the first non-arithmetic type found. The client is
301 // responsible for emitting appropriate error diagnostics.
Steve Naroffa4332e22007-07-17 00:58:39 +0000302 void UsualArithmeticConversions(Expr *&lExpr, Expr *&rExpr);
Steve Naroff3e5e5562007-07-16 22:23:01 +0000303
Reid Spencer5f016e22007-07-11 17:01:13 +0000304 enum AssignmentCheckResult {
305 Compatible,
306 Incompatible,
307 PointerFromInt,
308 IntFromPointer,
309 IncompatiblePointer,
310 CompatiblePointerDiscardsQualifiers
311 };
Steve Naroff90045e82007-07-13 23:32:42 +0000312 // CheckAssignmentConstraints - Perform type checking for assignment,
313 // argument passing, variable initialization, and function return values.
314 // This routine is only used by the following two methods. C99 6.5.16.
Reid Spencer5f016e22007-07-11 17:01:13 +0000315 AssignmentCheckResult CheckAssignmentConstraints(QualType lhs, QualType rhs);
Steve Naroff90045e82007-07-13 23:32:42 +0000316
317 // CheckSingleAssignmentConstraints - Currently used by ParseCallExpr,
318 // CheckAssignmentOperands, and ParseReturnStmt. Prior to type checking,
319 // this routine performs the default function/array converions.
320 AssignmentCheckResult CheckSingleAssignmentConstraints(QualType lhs,
321 Expr *&rExpr);
322 // CheckCompoundAssignmentConstraints - Type check without performing any
323 // conversions. For compound assignments, the "Check...Operands" methods
324 // perform the necessary conversions.
325 AssignmentCheckResult CheckCompoundAssignmentConstraints(QualType lhs,
326 QualType rhs);
327
Reid Spencer5f016e22007-07-11 17:01:13 +0000328 // Helper function for CheckAssignmentConstraints (C99 6.5.16.1p1)
329 AssignmentCheckResult CheckPointerTypesForAssignment(QualType lhsType,
330 QualType rhsType);
331
332 /// the following "Check" methods will return a valid/converted QualType
333 /// or a null QualType (indicating an error diagnostic was issued).
334
335 /// type checking binary operators (subroutines of ParseBinOp).
Steve Naroff49b45262007-07-13 16:58:59 +0000336 inline void InvalidOperands(SourceLocation l, Expr *&lex, Expr *&rex);
337 inline QualType CheckVectorOperands(SourceLocation l, Expr *&lex, Expr *&rex);
Reid Spencer5f016e22007-07-11 17:01:13 +0000338 inline QualType CheckMultiplyDivideOperands( // C99 6.5.5
Steve Naroff49b45262007-07-13 16:58:59 +0000339 Expr *&lex, Expr *&rex, SourceLocation OpLoc);
Reid Spencer5f016e22007-07-11 17:01:13 +0000340 inline QualType CheckRemainderOperands( // C99 6.5.5
Steve Naroff49b45262007-07-13 16:58:59 +0000341 Expr *&lex, Expr *&rex, SourceLocation OpLoc);
Reid Spencer5f016e22007-07-11 17:01:13 +0000342 inline QualType CheckAdditionOperands( // C99 6.5.6
Steve Naroff49b45262007-07-13 16:58:59 +0000343 Expr *&lex, Expr *&rex, SourceLocation OpLoc);
Reid Spencer5f016e22007-07-11 17:01:13 +0000344 inline QualType CheckSubtractionOperands( // C99 6.5.6
Steve Naroff49b45262007-07-13 16:58:59 +0000345 Expr *&lex, Expr *&rex, SourceLocation OpLoc);
Reid Spencer5f016e22007-07-11 17:01:13 +0000346 inline QualType CheckShiftOperands( // C99 6.5.7
Steve Naroff49b45262007-07-13 16:58:59 +0000347 Expr *&lex, Expr *&rex, SourceLocation OpLoc);
Reid Spencer5f016e22007-07-11 17:01:13 +0000348 inline QualType CheckRelationalOperands( // C99 6.5.8
Steve Naroff49b45262007-07-13 16:58:59 +0000349 Expr *&lex, Expr *&rex, SourceLocation OpLoc);
Reid Spencer5f016e22007-07-11 17:01:13 +0000350 inline QualType CheckEqualityOperands( // C99 6.5.9
Steve Naroff49b45262007-07-13 16:58:59 +0000351 Expr *&lex, Expr *&rex, SourceLocation OpLoc);
Reid Spencer5f016e22007-07-11 17:01:13 +0000352 inline QualType CheckBitwiseOperands( // C99 6.5.[10...12]
Steve Naroff49b45262007-07-13 16:58:59 +0000353 Expr *&lex, Expr *&rex, SourceLocation OpLoc);
Reid Spencer5f016e22007-07-11 17:01:13 +0000354 inline QualType CheckLogicalOperands( // C99 6.5.[13,14]
Steve Naroff49b45262007-07-13 16:58:59 +0000355 Expr *&lex, Expr *&rex, SourceLocation OpLoc);
Reid Spencer5f016e22007-07-11 17:01:13 +0000356 // CheckAssignmentOperands is used for both simple and compound assignment.
357 // For simple assignment, pass both expressions and a null converted type.
358 // For compound assignment, pass both expressions and the converted type.
359 inline QualType CheckAssignmentOperands( // C99 6.5.16.[1,2]
360 Expr *lex, Expr *rex, SourceLocation OpLoc, QualType convertedType);
361 inline QualType CheckCommaOperands( // C99 6.5.17
Steve Naroff49b45262007-07-13 16:58:59 +0000362 Expr *&lex, Expr *&rex, SourceLocation OpLoc);
Reid Spencer5f016e22007-07-11 17:01:13 +0000363 inline QualType CheckConditionalOperands( // C99 6.5.15
Steve Naroff49b45262007-07-13 16:58:59 +0000364 Expr *&cond, Expr *&lhs, Expr *&rhs, SourceLocation questionLoc);
Reid Spencer5f016e22007-07-11 17:01:13 +0000365
366 /// type checking unary operators (subroutines of ParseUnaryOp).
367 /// C99 6.5.3.1, 6.5.3.2, 6.5.3.4
368 QualType CheckIncrementDecrementOperand(Expr *op, SourceLocation OpLoc);
369 QualType CheckAddressOfOperand(Expr *op, SourceLocation OpLoc);
370 QualType CheckIndirectionOperand(Expr *op, SourceLocation OpLoc);
371 QualType CheckSizeOfAlignOfOperand(QualType type, SourceLocation loc,
372 bool isSizeof);
Steve Naroffe1b31fe2007-07-27 22:15:19 +0000373
374 /// type checking primary expressions.
375 QualType CheckOCUVectorComponent(QualType baseType, SourceLocation OpLoc,
376 IdentifierInfo &Comp, SourceLocation CmpLoc);
377
Reid Spencer5f016e22007-07-11 17:01:13 +0000378 /// C99: 6.7.5p3: Used by ParseDeclarator/ParseField to make sure we have
379 /// a constant expression of type int with a value greater than zero. If the
380 /// array has an incomplete type or a valid constant size, return false,
381 /// otherwise emit a diagnostic and return true.
382 bool VerifyConstantArrayType(const ArrayType *ary, SourceLocation loc);
383};
384
385
386} // end namespace clang
387
388#endif