]> granicus.if.org Git - clang/commitdiff
Sema: It's cheaper to ask LookupResult::empty than to calculate linkage
authorDavid Majnemer <david.majnemer@gmail.com>
Wed, 14 Jan 2015 08:08:52 +0000 (08:08 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Wed, 14 Jan 2015 08:08:52 +0000 (08:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225960 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDecl.cpp

index b967e17148dbb4c4b382f15d1070b9f25e9c39b3..007470344f1969737579491c8908b8d71108fe72 100644 (file)
@@ -8059,7 +8059,7 @@ bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD,
     // the function returns a UDT (class, struct, or union type) that is not C
     // compatible, and if it does, warn the user.
     // But, issue any diagnostic on the first declaration only.
-    if (NewFD->isExternC() && Previous.empty()) {
+    if (Previous.empty() && NewFD->isExternC()) {
       QualType R = NewFD->getReturnType();
       if (R->isIncompleteType() && !R->isVoidType())
         Diag(NewFD->getLocation(), diag::warn_return_value_udt_incomplete)