[clang] [clang] SemaFunctionEffects: When verifying a function, ignore any trailing 'requires' clause. (PR #114266)

Doug Wyatt via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 31 14:23:24 PDT 2024


dougsonos wrote:

> Also, @dougsonos, can you make a godbolt link for this? I’m trying to reproduce it, but compiling the code you provided doesn’t result in any diagnostics for me, but I might be missing a flag.

Yeah, I can't repro in godbolt either. This shows that all the effect analysis is in the clang-20 trunk on godbolt though:
https://godbolt.org/z/rP1E5ebhG

That makes me think that the issue may be specific to the um, older, version of libc++ that I've been testing against.

I'm pretty sure it has something to do with type traits in the requires() clause of the std::expected copy constructor, interacting badly with a global `operator&&` in `<valarray>`.

What I found impossible about creduce is that at some point it started ignoring requirements like the `requires` clause and collapsing all the templates.

Thanks for taking a look.

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


More information about the cfe-commits mailing list