Skip to content

Commit a8ddc3c

Browse files
ChuanqiXu9tru
authored andcommitted
[C++20] [Modules] Treat in class defined member functions in language linkage as implicitly inline
Close llvm#108732 This looks liek an oversight mostly. (cherry picked from commit 7046a9f)
1 parent b881b16 commit a8ddc3c

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

clang/lib/Sema/SemaDecl.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -9734,7 +9734,7 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, DeclContext *DC,
97349734
bool ImplicitInlineCXX20 = !getLangOpts().CPlusPlusModules ||
97359735
NewFD->isConstexpr() || NewFD->isConsteval() ||
97369736
!NewFD->getOwningModule() ||
9737-
NewFD->isFromExplicitGlobalModule() ||
9737+
NewFD->isFromGlobalModule() ||
97389738
NewFD->getOwningModule()->isHeaderLikeModule();
97399739
bool isInline = D.getDeclSpec().isInlineSpecified();
97409740
bool isVirtual = D.getDeclSpec().isVirtualSpecified();

clang/test/Modules/pr108732.cppm

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// RUN: %clang_cc1 -std=c++20 %s -ast-dump | FileCheck %s
2+
export module mod;
3+
4+
extern "C++" {
5+
class C
6+
{
7+
public:
8+
bool foo() const {
9+
return true;
10+
}
11+
};
12+
}
13+
14+
// CHECK: foo {{.*}}implicit-inline

0 commit comments

Comments
 (0)