llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

clang assert when using PragmaLoopHint with c++11 attribute.

Open jyu2-git opened this issue 6 years ago • 2 comments

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; } }

jyu2-git avatar Jun 16 '20 04:06 jyu2-git

Resolved with 4676cf444ea2678660ee48279be99efde4bf60e9 8c6c606cdc72c3ddd55f382d91ef1afc3cb9f2a8

yuanfang-chen avatar Jun 16 '20 22:06 yuanfang-chen

Thanks for the report. I'll take a look today.

yuanfang-chen avatar Jun 16 '20 16:06 yuanfang-chen