[clang] [clang][Interp] Don't diagnose undefined functions when checking... (PR #75051)

via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 13 01:22:46 PST 2023


================
@@ -371,13 +366,21 @@ bool CheckCallable(InterpState &S, CodePtr OpPC, const Function *F) {
       // FIXME: If DiagDecl is an implicitly-declared special member function
       // or an inheriting constructor, we should be much more explicit about why
       // it's not constexpr.
-      if (CD && CD->isInheritingConstructor())
+      if (CD && CD->isInheritingConstructor()) {
         S.FFDiag(Loc, diag::note_constexpr_invalid_inhctor, 1)
           << CD->getInheritedConstructor().getConstructor()->getParent();
-      else
+        S.Note(DiagDecl->getLocation(), diag::note_declared_at);
+      } else {
+        // Don't emit anything if the function isn't defined and we're checking
+        // for a constnat expression. It might be defined at the point we're
----------------
cor3ntin wrote:

```suggestion
        // for a constant expression. It might be defined at the point we're
```

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


More information about the cfe-commits mailing list