Changeset 90e683b for src/AST/Decl.hpp


Ignore:
Timestamp:
Feb 3, 2025, 11:46:55 AM (11 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
master
Children:
54f70c6
Parents:
bbbff10
Message:

I set out to do a enum rework. It ended up being much the same and I unwound the core rework. But I hope the new names are a bit clearer and other minor fixes are helpful, so I am keeping those.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Decl.hpp

    rbbbff10 r90e683b  
    306306enum class EnumAttribute{ Value, Posn, Label };
    307307
    308 /// enum declaration `enum Foo { ... };`
     308/// enum declaration `enum Foo { ... };` or `enum(...) Foo { ... };`
    309309class EnumDecl final : public AggregateDecl {
    310310public:
     
    317317        std::vector< ast::ptr<ast::EnumInstType>> inlinedDecl; // child enums
    318318
     319        bool is_c_enum     () const { return !isCfa; }
     320        bool is_opaque_enum() const { return isCfa && nullptr == base; }
     321        bool is_typed_enum () const { return isCfa && nullptr != base; }
     322
    319323        EnumDecl( const CodeLocation& loc, const std::string& name, bool isCfa = false,
    320324                std::vector<ptr<Attribute>>&& attrs = {}, Linkage::Spec linkage = Linkage::Cforall,
     
    331335        const char * typeString() const override { return aggrString( Enum ); }
    332336
    333         bool isTyped() const;
    334         bool isOpaque() const;
    335337private:
    336338        EnumDecl * clone() const override { return new EnumDecl{ *this }; }
Note: See TracChangeset for help on using the changeset viewer.