================
@@ -1327,6 +1327,60 @@ void 
Sema::AddImplicitMSFunctionNoBuiltinAttr(FunctionDecl *FD) {
     FD->addAttr(NoBuiltinAttr::CreateImplicit(Context, V.data(), V.size()));
 }
 
+NamedDecl *Sema::lookupExternCName(IdentifierInfo *IdentId,
+                                   SourceLocation NameLoc, Scope *curScope) {
+  LookupResult Result(*this, IdentId, NameLoc, LookupOrdinaryName);
+  LookupName(Result, curScope);
+  if (!getLangOpts().CPlusPlus)
+    return Result.getAsSingle<NamedDecl>();
+  for (LookupResult::iterator I = Result.begin(); I != Result.end(); ++I) {
+    NamedDecl *D = (*I)->getUnderlyingDecl();
+    if (auto *FD = dyn_cast<FunctionDecl>(D->getCanonicalDecl()))
+      if (FD->isExternC())
+        return D;
+    if (isa<VarDecl>(D->getCanonicalDecl()))
----------------
erichkeane wrote:

What is the purpose of this?  VarDecls can't be extern C, why would this be 
looked up here?

https://github.com/llvm/llvm-project/pull/141671
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to