sqlite_orm
sqlite_orm copied to clipboard
unit_tests project does not compile: error in concept while using VS2022 ver 17.3.1 (latest version)
ERROR: Q:\C++\sqlite_orm\include\sqlite_orm/sqlite_orm.h(7500,89): fatal error C1001: Internal compiler error.
Code at that line is:
/**
* Constraints a deleter to be or to yield a function pointer.
*/
template<typename D>
concept yields_fp = requires(D d) {
// yielding function pointer by using the plus trick
{+d};
requires std::is_function_v<std::remove_pointer_t<decltype(+d)>>;
};
my compiler is VS2022 ver 17.3.1 and language is /std:c++20 or /std:c++latest
You can verify the error by trying to compile the following code:
/**
* Constraints a deleter to be or to yield a function pointer.
*/
template<typename D>
concept yields_fp = requires(D d) {
// yielding function pointer by using the plus trick
{+d};
requires std::is_function_v<std::remove_pointer_t<decltype(+d)>>;
};
void ff(void) {}
auto demo(yields_fp auto arg) {
arg();
}
auto lam = []()
{
};
void main() {
demo(ff);
demo(lam); // INTERNAL COMPILER ERROR!
}
So the issue has something to do with lambdas...
IDK what can we do in case of internal compiler error. First of all this case must be reported to Microsoft. All I can tell you is to avoid this case to make your development work. Usually compiler errors can be avoided with code shuffling or refactoring
I reported to Microsoft They corrected it and scheduled for next version
Juan
Sent from my iPhone
On 23 Aug 2022, at 6:15 AM, Yevgeniy Zakharov @.***> wrote:
IDK what can we do in case of internal compiler error. First of all this case must be reported to Microsoft. All I can tell you is to avoid this case to make your development work. Usually compiler errors can be avoided with code shuffling or refactoring
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.
@juandent Do you have the link to the tracking issue that you reported? Then we can close this ticket...
closing due to inactivity