]> granicus.if.org Git - clang/commitdiff
Don't try to check override control for invalid member functions. Fixes a crash in...
authorRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 6 Sep 2012 18:32:18 +0000 (18:32 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 6 Sep 2012 18:32:18 +0000 (18:32 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163337 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDeclCXX.cpp
test/SemaTemplate/nested-template.cpp

index 2a221d8e5d57f8f7ffe75728e7d7feee79093f1f..318342ec7615fae053b3861cc8ff1cc7cc739b6c 100644 (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?
index 7849bae4d571855eff1588eff9f785364c0ef642..47502536caf7e3b5bff230189aa7d1fd77b536b9 100644 (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}}
+};