llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT--> @llvm/pr-subscribers-clang-modules Author: llvmbot <details> <summary>Changes</summary> Backport 52774473867e49b5891ab9381accf4e5a3ce0024 Requested by: @<!-- -->frederick-vs-ja --- Full diff: https://github.com/llvm/llvm-project/pull/219865.diff 2 Files Affected: - (modified) clang/lib/Sema/SemaDecl.cpp (+1-1) - (added) clang/test/Modules/pr218152.cppm (+17) ``````````diff diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 27fe259af3717..6a25a799aa219 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -18387,7 +18387,7 @@ Sema::ActOnTag(Scope *S, unsigned TagSpec, TagUseKind TUK, SourceLocation KWLoc, } if (getLangOpts().CPlusPlus && Name && DC && StdNamespace && - DC->Equals(getStdNamespace())) { + DC->getRedeclContext()->Equals(getStdNamespace())) { if (Name->isStr("bad_alloc")) { // This is a declaration of or a reference to "std::bad_alloc". isStdBadAlloc = true; diff --git a/clang/test/Modules/pr218152.cppm b/clang/test/Modules/pr218152.cppm new file mode 100644 index 0000000000000..c7b82372f42d6 --- /dev/null +++ b/clang/test/Modules/pr218152.cppm @@ -0,0 +1,17 @@ +// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify %s + +// expected-no-diagnostics +export module fake_std; + +extern "C++" { +namespace std { + using size_t = decltype(sizeof 0); + export enum class align_val_t : size_t {}; +} // namespace std + +export void *operator new(std::size_t, std::align_val_t); + +namespace std { +void foo() { align_val_t x{}; } +} // namespace std +} // extern "C++" `````````` </details> https://github.com/llvm/llvm-project/pull/219865 _______________________________________________ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
