Skip to content

[Bug]: Build failure on Windows with gcc 15.2: error: standard attributes in middle of decl-specifiers #4881

@WardBrian

Description

@WardBrian

Describe the issue

Starting with the most recent commit 065127f, building on Windows with gcc 15.2 raises an error:

 D:/a/walnuts/walnuts/build/_deps/googletest-src/googlemock/include/gmock/internal/gmock-internal-utils.h:304:7: error: standard attributes in middle of decl-specifiers
  304 |       GTEST_API_
      |       ^~~~~~~~~~
D:/a/walnuts/walnuts/build/_deps/googletest-src/googlemock/include/gmock/internal/gmock-internal-utils.h:304:7: note: standard attributes must precede the decl-specifiers to apply to the declaration, or follow them to apply to the type

These lines did indeed change in the commit that originates the problem.

Steps to reproduce the problem

See github actions: https://github.com/flatironinstitute/walnuts/actions/runs/20106717581/job/57714011338

What version of GoogleTest are you using?

065127f

What operating system and version are you using?

Windows

What compiler and version are you using?

gcc 15.2.0

What build system are you using?

cmake

Additional context

No response

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