[all-commits] [llvm/llvm-project] 79fa0e: [C++20] [Modules] Make member functions with a in-...

Chuanqi Xu via All-commits all-commits at lists.llvm.org
Mon Sep 12 22:13:24 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 79fa0ec8c4bfeeb21f7b44ebd9a66e7ec9781798
      https://github.com/llvm/llvm-project/commit/79fa0ec8c4bfeeb21f7b44ebd9a66e7ec9781798
  Author: Chuanqi Xu <yedeng.yd at linux.alibaba.com>
  Date:   2022-09-13 (Tue, 13 Sep 2022)

  Changed paths:
    M clang/lib/Sema/SemaDecl.cpp
    A clang/test/CodeGenCXX/header-unit-friend-within-class-linkage.cpp
    A clang/test/CodeGenCXX/header-unit-member-func-linkage.cpp
    M clang/unittests/AST/DeclTest.cpp

  Log Message:
  -----------
  [C++20] [Modules] Make member functions with a in-class definition in HU implicitly inline

According to [dcl.inline]p7/note4,

> In the global module, a function defined within a class definition is
> implicitly inline.

And the declarations in the header unit are attached to the global
module fragment. So the function defined within a class definition in
header units should be implicitly inline too.

This fixes https://github.com/llvm/llvm-project/issues/57571.




More information about the All-commits mailing list