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 | d643456d450adf341f97a96c59608263eb160f09 (patch) | |
tree | 1d77735240d3a8a3e78232aad94623f25dc96b8b /clang/lib/Parse/DeclSpec.cpp | |
parent | 9d809cad50204aa4358dac5439d81429b817c778 (diff) | |
download | bcm5719-llvm-d643456d450adf341f97a96c59608263eb160f09.tar.gz bcm5719-llvm-d643456d450adf341f97a96c59608263eb160f09.zip |
Reject incomplete types in exception specs.
llvm-svn: 72580
Diffstat (limited to 'clang/lib/Parse/DeclSpec.cpp')
-rw-r--r-- | clang/lib/Parse/DeclSpec.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/clang/lib/Parse/DeclSpec.cpp b/clang/lib/Parse/DeclSpec.cpp index 2a765d21248..f3ff0c63797 100644 --- a/clang/lib/Parse/DeclSpec.cpp +++ b/clang/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; } |