Skip to content

Conversation

Meinersbur
Copy link
Member

@Meinersbur Meinersbur commented Aug 9, 2024

Since ec50f58, compiling the unittests fail with

mlir\unittests\Support\CyclicReplacerCacheTest.cpp(30,40): error C2326: 'auto CachedCyclicReplacerTest_testInPlaceRecursionPruneAnywhere_Test::TestBody::<lambda_1>::operator ()(int) const': function cannot access 'replacer'

I think this is legal, as calling a lambda recursively is legal as well, as long as the declarator's type does not depend on the lambda's type. Explicitly listing the captures unbreaks the build for msvc. While it compiles, IntelliSense still shows it as error (red squiggly line).

Alternative to #101021

@ryanpholt
Copy link
Member

This still seems to fail with C++17 unless I'm missing something: https://godbolt.org/z/xYdqccW3s

It does seem to work with C++20.

@Meinersbur
Copy link
Member Author

I did not experiment with version flags. I can accept your version if that one works.

@ryanpholt
Copy link
Member

My version seems to always work so I think that would make the most sense.

@Meinersbur
Copy link
Member Author

Retract in favor of #101021

@Meinersbur Meinersbur closed this Aug 9, 2024
@Meinersbur Meinersbur deleted the mlir_support_replacer-compilefix branch September 24, 2025 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants