[clang] [clang][modules] Fix std::initializer_list recognition if it's exported out of a module (PR #118537)

Chuanqi Xu via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 3 19:33:50 PST 2024


================
@@ -11919,8 +11919,12 @@ bool Sema::isStdInitializerList(QualType Ty, QualType *Element) {
     CXXRecordDecl *TemplateClass = Template->getTemplatedDecl();
     if (TemplateClass->getIdentifier() !=
             &PP.getIdentifierTable().get("initializer_list") ||
-        !getStdNamespace()->InEnclosingNamespaceSetOf(
-            TemplateClass->getDeclContext()))
----------------
ChuanqiXu9 wrote:

Maybe we can fix it by replacing `getDeclContext()` with `getNonTransparentContext()`

https://github.com/llvm/llvm-project/pull/118537


More information about the cfe-commits mailing list