[all-commits] [llvm/llvm-project] e92be7: PR47682: Merge the DeclContext of a merged Functio...

Richard Smith via All-commits all-commits at lists.llvm.org
Fri Jan 22 15:47:01 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e92be7cd9f03ab3eb8c4a21e686743c2575a169a
      https://github.com/llvm/llvm-project/commit/e92be7cd9f03ab3eb8c4a21e686743c2575a169a
  Author: Richard Smith <richard at metafoo.co.uk>
  Date:   2021-01-22 (Fri, 22 Jan 2021)

  Changed paths:
    M clang/lib/Sema/SemaDecl.cpp
    M clang/test/SemaCXX/default1.cpp

  Log Message:
  -----------
  PR47682: Merge the DeclContext of a merged FunctionDecl before we inherit
default arguments.

When a function is declared with a qualified name, its eventual semantic
DeclContext may differ from the scope specified by the qualifier if it
redeclares a function in an inline namespace. In this case, we need to
update the DeclContext to be that of the previous declaration, and we
need to do so before we decide whether to inherit default arguments from
that previous declaration, because we only inherit default arguments
from declarations in the same scope.




More information about the All-commits mailing list