cppfront icon indicating copy to clipboard operation
cppfront copied to clipboard

fix(to_cpp1): improve recognition of dependent types and deducible parameters

Open JohelEGP opened this issue 2 years ago • 4 comments
trafficstars

Resolves #534. Resolves #595. Resolves #628 (as a discussion, this needs to be manually closed). Adds what's needed to diagnose #572.

JohelEGP avatar Jul 01 '23 17:07 JohelEGP

Turns out I was wrong. There's regression-tests/test-results/clang-12/pure2-bugfix-for-non-local-function-expression.cpp.output. It's just a mismatch between Herb's script and the CMake buildsystem I'm using.

Previous

I would like to test commit 024f554930f9804fe1ce4f3eab264126da2f9cf1. Unfortunately, there's no precedent for tests that fail with a hard error during Cpp1. And I don't just do it because, unlike Cppfront, the Cpp1 compilers emit the source's full path in the error, preventing me from committing portable test results.

JohelEGP avatar Jul 04 '23 16:07 JohelEGP

Patch for merging with #596:

diff --git a/source/to_cpp1.h b/source/to_cpp1.h
index 2ece7c3..503cf12 100644
--- a/source/to_cpp1.h
+++ b/source/to_cpp1.h
@@ -2019,6 +2019,12 @@ public:
         {
             return self->is_dependent(*expr.result_type);
         }
+
+        auto operator()(requires_expression_node const&) const
+             -> bool
+         {
+             return false;
+         }
     };
 
     auto is_dependent(

JohelEGP avatar Dec 12 '23 01:12 JohelEGP