[all-commits] [llvm/llvm-project] 3a3af2: [C++20] [Module] fix bug 47716 and implement [modu...

Chuanqi Xu via All-commits all-commits at lists.llvm.org
Sun Jan 23 18:37:10 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3a3af2bbc97e7db045eccb8683e93b9aa7ef562b
      https://github.com/llvm/llvm-project/commit/3a3af2bbc97e7db045eccb8683e93b9aa7ef562b
  Author: Chuanqi Xu <yedeng.yd at linux.alibaba.com>
  Date:   2022-01-24 (Mon, 24 Jan 2022)

  Changed paths:
    M clang/include/clang/AST/DeclBase.h
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/include/clang/Sema/Sema.h
    M clang/lib/AST/DeclBase.cpp
    M clang/lib/Sema/SemaDecl.cpp
    M clang/lib/Sema/SemaDeclCXX.cpp
    M clang/lib/Sema/SemaTemplate.cpp
    A clang/test/CXX/module/module.interface/p2-2.cpp
    A clang/test/CXX/module/module.interface/p6.cpp

  Log Message:
  -----------
  [C++20] [Module] fix bug 47716 and implement [module.interface]/p6

This fixes bug 47716.

According to [module.interface]p2, it is meaningless to export an entity
which is not in namespace scope.
The reason why the compiler crashes is that the compiler missed
ExportDecl when the compiler traverse the subclass of DeclContext. So
here is the crash.

Also, the patch implements [module.interface]p6 in
Sema::CheckRedeclaration* functions.

Reviewed By: aaron.ballman, urnathan

Differential Revision: https://reviews.llvm.org/D112903




More information about the All-commits mailing list