[all-commits] [llvm/llvm-project] 2a3b86: Fix rejects-valid when referencing an implicit ope...

Richard Smith via All-commits all-commits at lists.llvm.org
Mon Jun 22 20:19:53 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 2a3b86c157166f3b15f718443334ab0e27b40592
      https://github.com/llvm/llvm-project/commit/2a3b86c157166f3b15f718443334ab0e27b40592
  Author: Richard Smith <richard at metafoo.co.uk>
  Date:   2020-06-22 (Mon, 22 Jun 2020)

  Changed paths:
    M clang/include/clang/AST/DeclBase.h
    M clang/include/clang/Sema/Template.h
    M clang/lib/AST/DeclBase.cpp
    M clang/lib/Sema/SemaDecl.cpp
    M clang/lib/Sema/SemaDeclCXX.cpp
    M clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
    M clang/test/PCH/cxx2a-defaulted-comparison.cpp
    A clang/test/SemaTemplate/defaulted.cpp

  Log Message:
  -----------
  Fix rejects-valid when referencing an implicit operator== from within a
templated class.

When a defaulted operator<=> results in the injection of a defaulted
operator==, that operator== can be named by unqualified name within the
same class, even if the class is templated. To make this work, perform
the transform from defaulted operator<=> to defaulted operator== in the
template definition context instead of the template instantiation
context.

This results in our substituting into a declaration from a context where
we don't have a full list of template arguments (or indeed any), for
which we are now more careful to not spuriously instantiate declarations
that are not dependent on the arguments we're substituting.




More information about the All-commits mailing list