Changeset d3d54b3 for src/AST/Util.hpp


Ignore:
Timestamp:
Feb 5, 2025, 1:45:29 PM (2 months ago)
Author:
Michael Brooks <mlbrooks@…>
Branches:
master
Children:
ab94c37
Parents:
92aeae1
Message:

Eliminate warnings due to sizeof returning type inconsistent with %zu. Fix #269.

Test

nowarn/printf-sizeof

: Activate direct test of the bug.

Tests

alloc-ERROR
extension
array-collections/dimexpr-match-c-ERRS

: Accommodate incidental changes in error-message text or generated code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified src/AST/Util.hpp

    r92aeae1 rd3d54b3  
    1616#pragma once
    1717
     18#include "Fwd.hpp"
     19
    1820namespace ast {
    1921
     
    2224/// Check anything that should always be true of the AST between passes.
    2325/// Insert this whenever you want additional debugging checks.
    24 void checkInvariants( TranslationUnit & transUnit );
     26void checkInvariants( TranslationUnit & );
     27
     28/// Maintains an AST-module state for contextual information needed in
     29/// ast::* implementations, notably constructors:
     30///    early: while parsing, use bootstrap versions
     31///    late: once a whole TranslationUnit exists, use its answers
     32/// When the program is in the later state, ast::* construcors effectively get
     33/// the benefit of WithTranslationUnit, without having to pass them one.
     34class TranslationDeps {
     35
     36    TranslationDeps() = delete;
     37
     38    friend class SizeofExpr;
     39    friend class AlignofExpr;
     40    friend class CountofExpr;
     41    friend class OffsetofExpr;
     42    friend class OffsetPackExpr;
     43
     44    /// Appropriate return type for built-in expressions that report on sizes
     45    static const Type * getSizeType();
     46
     47  public:
     48    /// Transition from early to late states
     49    static void evolve( TranslationUnit & );
     50};
    2551
    2652}
Note: See TracChangeset for help on using the changeset viewer.