Changeset ef05cf0


Ignore:
Timestamp:
May 1, 2025, 11:29:29 AM (5 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
master
Children:
57c7e6c4
Parents:
b1f225e5
Message:

Moved over some clean-up I did in various attempted fixes. InitDepthChecker has a very rare error case that has now been removed.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • libcfa/prelude/prelude-gen.cc

    rb1f225e5 ref05cf0  
    149149}
    150150
    151 template <typename... T>
    152 constexpr auto make_array(T&&... values) ->
    153     std::array<
    154         typename std::decay<typename std::common_type<T...>::type>::type,
    155         sizeof...(T)>
    156 {
    157     return std::array<
    158         typename std::decay<
    159             typename std::common_type<T...>::type>::type,
    160         sizeof...(T)>{{std::forward<T>(values)...}};
     151template<typename... T>
     152using make_array_t = std::array<std::decay_t<std::common_type_t<T...>>, sizeof...(T)>;
     153
     154template<typename... T>
     155constexpr make_array_t<T...> make_array(T&&... values) {
     156        return make_array_t<T...>{{std::forward<T>(values)...}};
    161157}
    162158
  • src/InitTweak/InitTweak.cpp

    rb1f225e5 ref05cf0  
    6868        };
    6969
    70         struct InitDepthChecker {
     70        struct InitDepthChecker : public ast::WithShortCircuiting {
    7171                bool result = true;
    7272                const ast::Type * type;
     
    8686                void postvisit( ast::ListInit const * ) {
    8787                        curDepth--;
     88                }
     89                void previsit( ast::SingleInit const * ) {
     90                        // We don't want to visit the value field.
     91                        visit_children = false;
    8892                }
    8993        };
  • src/Parser/TypeData.cpp

    rb1f225e5 ref05cf0  
    737737                        location,
    738738                        "?=?",
    739                         {}, // forall
    740                         {}, // assertions
    741739                        {
    742740                                new ast::ObjectDecl(
     
    779777                        location,
    780778                        "?{}",
    781                         {}, // forall
    782                         {}, // assertions
    783779                        {
    784780                                new ast::ObjectDecl(
     
    802798                        location,
    803799                        "?{}",
    804                         {}, // forall
    805                         {}, // assertions
    806800                        {
    807801                                new ast::ObjectDecl(
     
    834828                        location,
    835829                        "^?{}",
    836                         {}, // forall
    837                         {}, // assertions
    838830                        {
    839831                                new ast::ObjectDecl(
     
    882874                        location,
    883875                        "?=?",
    884                         {}, // forall
    885                         {}, // assertions
    886876                        {
    887877                                new ast::ObjectDecl(
     
    924914                        location,
    925915                        "?{}",
    926                         {}, // forall
    927                         {}, // assertions
    928916                        {
    929917                                new ast::ObjectDecl(
     
    948936                        location,
    949937                        "?{}",
    950                         {}, // forall
    951                         {}, // assertions
    952938                        {
    953939                                new ast::ObjectDecl(
     
    981967                        location,
    982968                        "^?{}",
    983                         {}, // forall
    984                         {}, // assertions
    985969                        {
    986970                                new ast::ObjectDecl(
Note: See TracChangeset for help on using the changeset viewer.