llvm/llvm-project

guarded_by attributes not supported using c++11 style

Open

#158.116 aberto em 11 de set. de 2025

Ver no GitHub
 (10 comments) (0 reactions) (0 assignees)C++ (10.782 forks)batch import
clang:frontendgood first issue

Métricas do repositório

Stars
 (26.378 stars)
Métricas de merge de PR
 (Mesclagem média 1d 2h) (1.000 fundiu PRs em 30d)

Description

#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)]];
      |             ^~~~~~~~~~~~~~~~~

Guia do colaborador