]> granicus.if.org Git - clang/commitdiff
Replace incorrect usage of isInvalidDecl with intended setInvalidDecl
authorErich Keane <erich.keane@intel.com>
Wed, 21 Feb 2018 20:29:05 +0000 (20:29 +0000)
committerErich Keane <erich.keane@intel.com>
Wed, 21 Feb 2018 20:29:05 +0000 (20:29 +0000)
This typo would cause an attempt to multiversion 'main' to issue an
error, but not mark the function as invalid.  This patch fixes it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@325716 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDecl.cpp

index 84f75ff64552ea620864a7b75930f015c0d519f5..df1d02d8faa9e7c75dd602c574a2a7d9307b3ebd 100644 (file)
@@ -9324,7 +9324,7 @@ static bool CheckMultiVersionFunction(Sema &S, FunctionDecl *NewFD,
   if (NewFD->isMain()) {
     if (NewTA && NewTA->isDefaultVersion()) {
       S.Diag(NewFD->getLocation(), diag::err_multiversion_not_allowed_on_main);
-      NewFD->isInvalidDecl();
+      NewFD->setInvalidDecl();
       return true;
     }
     return false;