sqlite_orm icon indicating copy to clipboard operation
sqlite_orm copied to clipboard

unit_tests project does not compile: error in concept while using VS2022 ver 17.3.1 (latest version)

Open juandent opened this issue 2 years ago • 2 comments

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...

juandent avatar Aug 22 '22 21:08 juandent

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

fnc12 avatar Aug 23 '22 12:08 fnc12

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 avatar Aug 23 '22 13:08 juandent

@juandent Do you have the link to the tracking issue that you reported? Then we can close this ticket...

trueqbit avatar Mar 18 '23 21:03 trueqbit

closing due to inactivity

fnc12 avatar Oct 08 '23 13:10 fnc12