[clang] [Clang][Sema] Fix exception specification comparison for functions with different template depths (PR #111561)

Matheus Izvekov via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 18 10:16:11 PDT 2024


================
@@ -314,6 +316,22 @@ bool Sema::CheckEquivalentExceptionSpec(FunctionDecl *Old, FunctionDecl *New) {
     return false;
   }
 
+  if (Old->getExceptionSpecType() == EST_DependentNoexcept &&
+      New->getExceptionSpecType() == EST_DependentNoexcept) {
+    const auto *OldType = Old->getType()->getAs<FunctionProtoType>();
+    const auto *NewType = New->getType()->getAs<FunctionProtoType>();
+    OldType = ResolveExceptionSpec(New->getLocation(), OldType);
----------------
mizvekov wrote:

```suggestion
    OldType = ResolveExceptionSpec(Old->getLocation(), OldType);
```

https://github.com/llvm/llvm-project/pull/111561


More information about the cfe-commits mailing list