Giter Club home page Giter Club logo

Comments (2)

Naios avatar Naios commented on August 20, 2024

CTI_DETAIL_TRAP is platform implemented and will lead to this behaviour dependent on your platform:

/// Causes the application to exit abnormally
#if defined(_MSC_VER)
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define CTI_DETAIL_TRAP() __debugbreak()
#elif defined(__GNUC__)
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define CTI_DETAIL_TRAP() __builtin_trap()
#elif defined(__has_builtin) && __has_builtin(__builtin_trap)
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define CTI_DETAIL_TRAP() __builtin_trap()
#else
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define CTI_DETAIL_TRAP() *(volatile int*)0x11 = 0
#endif

The implementation of this macro aligns with the way how LLVM is handling traps.

The greater issue here is that the unhandled exception handler is called although you provided a handler in fail,
however I was not reproduce this since your code runs fine for me:

TEST(regression_tests, fail_handler_called) {
  make_exceptional_continuable<int>(supply_test_exception()).fail([]() {
    return 1;
  });
}

Additionally this usage scenario has a test case already:

TYPED_TEST(single_dimension_tests, are_exceptions_partial_applyable) {

in continuable/test/unit-test/multi/test-continuable-base-errors.cpp

Maybe you left code from debugging that leads to this behaviour?

from continuable.

yaoyuan1216 avatar yaoyuan1216 commented on August 20, 2024

@Naios yeah, you are right. I neglected one line code.
auto continuable = make_exceptional_continuable<void>(supply_test_exception());
So sorry!

from continuable.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.