Skip to content

Commit bde5ede

Browse files
committedFeb 19, 2016
[Sema] PR25181 Fix crash when method declaration with throw spec fails to parse correctly
Fixes crash referenced in PR25181 where dyn_cast is called on a null instance of LM.Method. Reviewers: majnemer, rnk Patch by Don Hinton Differential Revision: http://reviews.llvm.org/D17072 llvm-svn: 261292
1 parent eafc693 commit bde5ede

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed
 

‎clang/lib/Parse/ParseCXXInlineMethods.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ NamedDecl *Parser::ParseCXXInlineMethodDef(AccessSpecifier AS,
5252
}
5353
}
5454

55-
HandleMemberFunctionDeclDelays(D, FnD);
55+
if (FnD)
56+
HandleMemberFunctionDeclDelays(D, FnD);
5657

5758
D.complete(FnD);
5859

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
2+
// Don't crash (PR25181).
3+
4+
template <typename T> class Foo { // expected-note {{template parameter is declared here}}
5+
template <typename T> // expected-error {{declaration of 'T' shadows template parameter}}
6+
void Foo<T>::method(T *) const throw() {} // expected-error {{nested name specifier 'Foo<T>::' for declaration does not refer into a class, class template or class template partial specialization}}
7+
};

0 commit comments

Comments
 (0)