[llvm-bugs] [Bug 36645] New: isCXX11ConstantExpr related segfault
via llvm-bugs
llvm-bugs at lists.llvm.org
Thu Mar 8 01:46:02 PST 2018
https://bugs.llvm.org/show_bug.cgi?id=36645
Bug ID: 36645
Summary: isCXX11ConstantExpr related segfault
Product: clang
Version: unspecified
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++
Assignee: unassignedclangbugs at nondot.org
Reporter: taruti at taruti.net
CC: dgregor at apple.com, llvm-bugs at lists.llvm.org
Created attachment 20019
--> https://bugs.llvm.org/attachment.cgi?id=20019&action=edit
clang 6.0 crash
OpenCPN recently enabled C++11 and when trying out clang instead of gcc I
stumbled upon a crash in clang. This seems to occur on both 6.0.0-1 and a trunk
version in Debian sid.
The crash goes away with -std=c++98.
This is enough to reproduce this (produced by multidelta)
```
struct DATUM {
const char *name;
short ellipsoid;
};
struct DATUM const gDatum[] = {
{ "Adindan", 5}
};
void datumParams(short datum, double *a, double *es) {
extern struct DATUM const gDatum[];
}
static int isWGS84(int i) {
if (gDatum[i].ellipsoid != gDatum[0].ellipsoid) return i;
```
Which crashes with:
clang++-7 -c georef.ii -O0 -emit-llvm -o /dev/null
clang++-6.0 -c georef.ii -O0 -emit-llvm -o /dev/null
and does not crash with -std=c++98.
Attached are logs of crashes from both clang versions and a preprocessed
original source file. Original source is at https://github.com/OpenCPN/OpenCPN
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180308/e026680e/attachment.html>
More information about the llvm-bugs
mailing list