Changeset 7c38d53


Ignore:
Timestamp:
May 19, 2020, 1:36:42 PM (5 years ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
7d6e01d
Parents:
314dab6
Message:

Added mark_exception to reduce the chance something is accidentally treated as an exception.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/exception.hfa

    r314dab6 r7c38d53  
    1414//
    1515
    16 // WARNING: This is for documentation as it will match ANY type.
    1716trait is_exception(dtype T) {
    18         /* The first field must be a pointer to a virtual table.
    19          * That virtual table must be a decendent of the base exception virtual table.
    20          */
     17        // The trait system can't describe the actual constrants.
     18        // Unused, should always be a no-op.
     19        void mark_exception(T *);
    2120};
    2221
     
    8180#define _VTABLE_DECLARATION(exception_name, parent_name, ...) \
    8281        struct exception_name; \
     82        void mark_exception(exception_name *); \
    8383        VTABLE_TYPE(exception_name); \
    8484        extern VTABLE_TYPE(exception_name) VTABLE_NAME(exception_name); \
     
    9797#define VTABLE_INSTANCE(...) _EXC_DISPATCH(_VTABLE_INSTANCE, __VA_ARGS__)
    9898#define _VTABLE_INSTANCE(exception_name, parent_name, ...) \
     99        void mark_exception(exception_name *) {} \
    99100        void _GLUE2(exception_name,_copy)(exception_name * this, exception_name * other) { \
    100101                *this = *other; \
Note: See TracChangeset for help on using the changeset viewer.