diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2009-05-29 18:02:33 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2009-05-29 18:02:33 +0000 |
commit | ef65f06e8e440aec541442cfd73a8a836e9bc842 (patch) | |
tree | c62611a51513fbe058801939f3a6adc116fca546 /lib/Parse/DeclSpec.cpp | |
parent | 8ebefded18aa3c83b6b4ce3713060c94432f9859 (diff) |
Reject incomplete types in exception specs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72580 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/DeclSpec.cpp')
-rw-r--r-- | lib/Parse/DeclSpec.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/Parse/DeclSpec.cpp b/lib/Parse/DeclSpec.cpp index 2a765d2124..f3ff0c6379 100644 --- a/lib/Parse/DeclSpec.cpp +++ b/lib/Parse/DeclSpec.cpp @@ -35,6 +35,7 @@ DeclaratorChunk DeclaratorChunk::getFunction(bool hasProto, bool isVariadic, bool hasExceptionSpec, bool hasAnyExceptionSpec, ActionBase::TypeTy **Exceptions, + SourceRange *ExceptionRanges, unsigned NumExceptions, SourceLocation Loc, Declarator &TheDeclarator) { @@ -72,9 +73,11 @@ DeclaratorChunk DeclaratorChunk::getFunction(bool hasProto, bool isVariadic, } // new[] an exception array if needed if (NumExceptions) { - I.Fun.Exceptions = new ActionBase::TypeTy*[NumExceptions]; - memcpy(I.Fun.Exceptions, Exceptions, - sizeof(ActionBase::TypeTy*)*NumExceptions); + I.Fun.Exceptions = new DeclaratorChunk::TypeAndRange[NumExceptions]; + for (unsigned i = 0; i != NumExceptions; ++i) { + I.Fun.Exceptions[i].Ty = Exceptions[i]; + I.Fun.Exceptions[i].Range = ExceptionRanges[i]; + } } return I; } |