https://bugs.llvm.org/show_bug.cgi?id=37906
Bug ID: 37906
Summary: valid sizeof operation introduced compiler crash
Product: clang
Version: trunk
Hardware: PC
OS: Windows NT
Status: NEW
Severity: normal
Priority: P
Component: Frontend
Assignee: unassignedclangb...@nondot.org
Reporter: picke...@synopsys.com
CC: llvm-bugs@lists.llvm.org
The following C test case causes clang to crash.
Assertion failed: (ND->isUsed(false) || !isa<VarDecl>(ND) ||
!E->getLocation().isValid()) && "Should not use decl without marking it used!",
file C:\src\llvm_package_333363\llvm\tools\clang\lib\CodeGen\CGExpr.cpp, line
2453
% clang --version
clang version 7.0.0 (trunk)
Target: i686-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Program Files (x86)\LLVM\bin
Test case:
---------------- test.c --------------------------------------
#include <stdarg.h>
extern void exit (int);
extern void abort (void);
char a[1];
void
f1 (void)
{
int i = 0;
int j = sizeof (typeof (*(++i, (char (*)[i])a)));
if (i != 1 || j != 1)
abort ();
}
int
main (void)
{
f1 ();
exit (0);
}
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs