llvm/llvm-project

guarded_by attributes not supported using c++11 style

Open

#158.116 aperta il 11 set 2025

Vedi su GitHub
 (10 commenti) (0 reazioni) (0 assegnatari)C++ (10.782 fork)batch import
clang:frontendgood first issue

Metriche repository

Star
 (26.378 star)
Metriche merge PR
 (Merge medio 1g 2h) (1000 PR mergiate in 30 g)

Descrizione

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

Guida contributor