[all-commits] [llvm/llvm-project] 30adb9: let EST_Uninstantiated in FunctionProtoType::canTh...

Zhouyi Zhou via All-commits all-commits at lists.llvm.org
Wed Mar 16 07:09:56 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 30adb9fd279785d18f9902ba980c7d8b31a6c8d7
      https://github.com/llvm/llvm-project/commit/30adb9fd279785d18f9902ba980c7d8b31a6c8d7
  Author: Zhouyi Zhou <zhouzhouyi at gmail.com>
  Date:   2022-03-16 (Wed, 16 Mar 2022)

  Changed paths:
    M clang/lib/AST/Type.cpp
    A clang/test/SemaTemplate/class-template-noexcept.cpp

  Log Message:
  -----------
  let EST_Uninstantiated in FunctionProtoType::canThrow return
CT_Dependent

When compile following code without -std=c++17, clang will abort by
llvm_unreachable:

class A {
  public:

  static const char X;

};
const char A::X = 0;

template<typename U> void func() noexcept(U::X);

template<class... B, char x>
void foo(void(B...) noexcept(x)) {}

void bar()
{

  foo(func<A>);

}

So, my solution is to let EST_Uninstantiated in
FunctionProtoType::canThrow return CT_Dependent

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




More information about the All-commits mailing list