Don't try to check override control for invalid member functions. Fixes a crash in a corner case. Patch by Olivier Goffart!

llvm-svn: 163337
This commit is contained in:
Richard Smith 2012-09-06 18:32:18 +00:00
parent 866908c42c
commit 09b031fbc0
2 changed files with 8 additions and 0 deletions

View File

@ -1420,6 +1420,9 @@ bool Sema::ActOnAccessSpecifier(AccessSpecifier Access,
/// CheckOverrideControl - Check C++11 override control semantics.
void Sema::CheckOverrideControl(Decl *D) {
if (D->isInvalidDecl())
return;
const CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(D);
// Do we know which functions this declaration might be overriding?

View File

@ -155,3 +155,8 @@ namespace PR10924 {
{
};
}
class Outer1 {
template <typename T> struct X;
template <typename T> int X<T>::func() {} // expected-error{{out-of-line definition of 'func' from class 'X<T>' without definition}}
};