Skip to content

guarded_by attributes not supported using c++11 style #158116

@nickdesaulniers

Description

@nickdesaulniers
#include <mutex>

class Foo {
    std::mutex m;
    int y __attribute__((guarded_by(m)));
    int z [[clang::guarded_by(m)]];
};
<source>:6:13: warning: unknown attribute 'clang::guarded_by' ignored [-Wunknown-attributes]
    6 |     int z [[clang::guarded_by(m)]];
      |             ^~~~~~~~~~~~~~~~~

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"good first issuehttps://github.com/llvm/llvm-project/contribute

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions