diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2009-05-31 11:47:27 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2009-05-31 11:47:27 +0000 |
commit | 3cc9726a493d90bd8faf094986a59352fd3461cb (patch) | |
tree | 10af8c1f45331dd39bdbef629c21d8682432a895 /lib/Parse/ParseDecl.cpp | |
parent | bb6415c69fc6440c337970e39749d4d482d9de42 (diff) |
Disallow exception specs on typedefs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72664 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDecl.cpp')
-rw-r--r-- | lib/Parse/ParseDecl.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index 4fc713c885..39eaf36c95 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -2274,6 +2274,7 @@ void Parser::ParseFunctionDeclarator(SourceLocation LParenLoc, Declarator &D, // cv-qualifier-seq[opt]. DeclSpec DS; bool hasExceptionSpec = false; + SourceLocation ThrowLoc; bool hasAnyExceptionSpec = false; llvm::SmallVector<TypeTy*, 2> Exceptions; llvm::SmallVector<SourceRange, 2> ExceptionRanges; @@ -2285,6 +2286,7 @@ void Parser::ParseFunctionDeclarator(SourceLocation LParenLoc, Declarator &D, // Parse exception-specification[opt]. if (Tok.is(tok::kw_throw)) { hasExceptionSpec = true; + ThrowLoc = Tok.getLocation(); ParseExceptionSpecification(Loc, Exceptions, ExceptionRanges, hasAnyExceptionSpec); assert(Exceptions.size() == ExceptionRanges.size() && @@ -2299,7 +2301,7 @@ void Parser::ParseFunctionDeclarator(SourceLocation LParenLoc, Declarator &D, SourceLocation(), /*arglist*/ 0, 0, DS.getTypeQualifiers(), - hasExceptionSpec, + hasExceptionSpec, ThrowLoc, hasAnyExceptionSpec, Exceptions.data(), ExceptionRanges.data(), @@ -2448,6 +2450,7 @@ void Parser::ParseFunctionDeclarator(SourceLocation LParenLoc, Declarator &D, DeclSpec DS; bool hasExceptionSpec = false; + SourceLocation ThrowLoc; bool hasAnyExceptionSpec = false; llvm::SmallVector<TypeTy*, 2> Exceptions; llvm::SmallVector<SourceRange, 2> ExceptionRanges; @@ -2460,6 +2463,7 @@ void Parser::ParseFunctionDeclarator(SourceLocation LParenLoc, Declarator &D, // Parse exception-specification[opt]. if (Tok.is(tok::kw_throw)) { hasExceptionSpec = true; + ThrowLoc = Tok.getLocation(); ParseExceptionSpecification(Loc, Exceptions, ExceptionRanges, hasAnyExceptionSpec); assert(Exceptions.size() == ExceptionRanges.size() && @@ -2472,7 +2476,7 @@ void Parser::ParseFunctionDeclarator(SourceLocation LParenLoc, Declarator &D, EllipsisLoc, ParamInfo.data(), ParamInfo.size(), DS.getTypeQualifiers(), - hasExceptionSpec, + hasExceptionSpec, ThrowLoc, hasAnyExceptionSpec, Exceptions.data(), ExceptionRanges.data(), @@ -2551,7 +2555,8 @@ void Parser::ParseFunctionDeclaratorIdentifierList(SourceLocation LParenLoc, SourceLocation(), &ParamInfo[0], ParamInfo.size(), /*TypeQuals*/0, - /*exception*/false, false, 0, 0, 0, + /*exception*/false, + SourceLocation(), false, 0, 0, 0, LParenLoc, D), RLoc); } |