Skip to content

noexcept can't be followed by __attribute__ #139

Closed

Description

@shi-yan

failed to parse the following code:

inline constexpr vk::SparseMemoryBindFlags operator|(vk::SparseMemoryBindFlagBits bit0, vk::SparseMemoryBindFlagBits bit1) noexcept __attribute__((always_inline)) {
}

the current parser doesn't allow noexcept followed by attribute

translation_unit [0, 0] - [2, 0]
  function_definition [0, 0] - [1, 1]
    storage_class_specifier [0, 0] - [0, 6]
    type_qualifier [0, 7] - [0, 16]
    type: qualified_identifier [0, 17] - [0, 42]
      scope: namespace_identifier [0, 17] - [0, 19]
      name: type_identifier [0, 21] - [0, 42]
    declarator: function_declarator [0, 43] - [0, 162]
      declarator: operator_name [0, 43] - [0, 52]
      parameters: parameter_list [0, 52] - [0, 122]
        parameter_declaration [0, 53] - [0, 86]
          type: qualified_identifier [0, 53] - [0, 81]
            scope: namespace_identifier [0, 53] - [0, 55]
            name: type_identifier [0, 57] - [0, 81]
          declarator: identifier [0, 82] - [0, 86]
        parameter_declaration [0, 88] - [0, 121]
          type: qualified_identifier [0, 88] - [0, 116]
            scope: namespace_identifier [0, 88] - [0, 90]
            name: type_identifier [0, 92] - [0, 116]
          declarator: identifier [0, 117] - [0, 121]
      ERROR [0, 123] - [0, 131]
      attribute_specifier [0, 132] - [0, 162]
        argument_list [0, 146] - [0, 161]
          identifier [0, 147] - [0, 160]
    body: compound_statement [0, 163] - [1, 1]

Activity

  1. jdrouhard commented on Dec 13, 2021

    @jdrouhard
    Collaborator

    While not a fix, c++ standard attribute expressions are fully supported (such as [[gnu::always_inline]]).

    Supporting __attribute__ in all the places it can appear is also discussed in #47.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions