https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118969
Bug ID: 118969
Summary: GCC accepts a program containing the [[likely]]
attribute outside of a function context, while Clang
correctly rejects it due to a syntax error.
Product: gcc
Version: 14.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: qurong at ios dot ac.cn
Target Milestone: ---
The compiler gcc(from gcc10.1-gcc14.2) accepts this program and clang will
reject it.
Test Program:
[[likely]] void f() {
}
int main() {
f();
return 0;
}