llvm/llvm-project

guarded_by attributes not supported using c++11 style

Open

#158,116 创建于 2025年9月11日

在 GitHub 查看
 (10 评论) (0 反应) (0 负责人)C++ (10,782 fork)batch import
clang:frontendgood first issue

仓库指标

Star
 (26,378 star)
PR 合并指标
 (平均合并 1天 2小时) (30 天内合并 1,000 个 PR)

描述

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

贡献者指南