diff options
| author | Ed Schouten <ed@FreeBSD.org> | 2009-06-06 08:21:31 +0000 |
|---|---|---|
| committer | Ed Schouten <ed@FreeBSD.org> | 2009-06-06 08:21:31 +0000 |
| commit | 37f6c480c696a4a72c1701ee54624cc807aa80ba (patch) | |
| tree | 06d57bb7679a2140aef96db7105a0bd5f16a4358 /include/clang/AST/Decl.h | |
| parent | 2659aeb5e51fe27d24bbffad0d1851b39fed5e43 (diff) | |
Diffstat (limited to 'include/clang/AST/Decl.h')
| -rw-r--r-- | include/clang/AST/Decl.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h index e134aed73d770..7440e7b5f1508 100644 --- a/include/clang/AST/Decl.h +++ b/include/clang/AST/Decl.h @@ -515,10 +515,22 @@ public: objcDeclQualifier = QTVal; } - const Expr *getDefaultArg() const { return DefaultArg; } - Expr *getDefaultArg() { return DefaultArg; } + const Expr *getDefaultArg() const { + assert(!hasUnparsedDefaultArg() && "Default argument is not yet parsed!"); + return DefaultArg; + } + Expr *getDefaultArg() { + assert(!hasUnparsedDefaultArg() && "Default argument is not yet parsed!"); + return DefaultArg; + } void setDefaultArg(Expr *defarg) { DefaultArg = defarg; } + /// hasDefaultArg - Determines whether this parameter has a default argument, + /// either parsed or not. + bool hasDefaultArg() const { + return DefaultArg != 0; + } + /// hasUnparsedDefaultArg - Determines whether this parameter has a /// default argument that has not yet been parsed. This will occur /// during the processing of a C++ class whose member functions have |
