Skip to content

Commit 7046a9f

Browse files
committed
[C++20] [Modules] Treat in class defined member functions in language linkage as implicitly inline
Close #108732 This looks liek an oversight mostly.
1 parent 33533ba commit 7046a9f

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

clang/lib/Sema/SemaDecl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9768,7 +9768,7 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, DeclContext *DC,
97689768
bool ImplicitInlineCXX20 = !getLangOpts().CPlusPlusModules ||
97699769
NewFD->isConstexpr() || NewFD->isConsteval() ||
97709770
!NewFD->getOwningModule() ||
9771-
NewFD->isFromExplicitGlobalModule() ||
9771+
NewFD->isFromGlobalModule() ||
97729772
NewFD->getOwningModule()->isHeaderLikeModule();
97739773
bool isInline = D.getDeclSpec().isInlineSpecified();
97749774
bool isVirtual = D.getDeclSpec().isVirtualSpecified();

clang/test/Modules/pr108732.cppm

Lines changed: 14 additions & 0 deletions
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)