[all-commits] [llvm/llvm-project] 48f73e: Fix assertion when generating diagnostic for inlin...

Aaron Ballman via All-commits all-commits at lists.llvm.org
Fri Aug 20 06:51:04 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 48f73ee666a264d23716ff6bb671cad836b65ccf
      https://github.com/llvm/llvm-project/commit/48f73ee666a264d23716ff6bb671cad836b65ccf
  Author: Aaron Ballman <aaron at aaronballman.com>
  Date:   2021-08-20 (Fri, 20 Aug 2021)

  Changed paths:
    M clang/include/clang/AST/Decl.h
    M clang/include/clang/AST/DeclBase.h
    M clang/lib/AST/DeclBase.cpp
    M clang/test/Misc/diag-inline-namespace.cpp

  Log Message:
  -----------
  Fix assertion when generating diagnostic for inline namespaces

When calculating the name to display for inline namespaces, we have
custom logic to try to hide redundant inline namespaces from the
diagnostic. Calculating these redundancies requires performing a lookup
in the parent declaration context, but that lookup should not try to
look through transparent declaration contexts, like linkage
specifications. Instead, loop up the declaration context chain until we
find a non-transparent context and use that instead.

This fixes PR49954.




More information about the All-commits mailing list