clang assert when using PragmaLoopHint with c++11 attribute.
| Bugzilla Link | 46336 |
| Resolution | FIXED |
| Resolved on | Jun 16, 2020 15:11 |
| Version | trunk |
| OS | All |
| CC | @DougGregor,@zygoloid,@yuanfang-chen |
Extended Description
The following test assert. This is regress from change of commit 9c2e770034d04a0966b84cac14a9e3fb3b0d4ab7
bash-4.4$ clang -cc1 x.cpp clang: /export/iusers/jyu2/git/llorg/llvm/clang/lib/Parse/ParseStmt.cpp:2199: clang::StmtResult clang::Parser::ParsePragmaLoopHint(clang::Parser::StmtVector&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::Parser::ParsedAttributesWithRange&): Assertion `Attrs.Range.getBegin().isInvalid() && "start of attribute range already set"' failed. PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
bash-4.4$ cat x.cpp
void foo(int i) { switch (i) { case 1: #pragma unroll [[fallthrough]]; case 2: for (int i = 0; i < 10; ++i); break; } }
Resolved with 4676cf444ea2678660ee48279be99efde4bf60e9 8c6c606cdc72c3ddd55f382d91ef1afc3cb9f2a8
Thanks for the report. I'll take a look today.