[llvm-bugs] [Bug 31326] New: Typo correction crash with pch file

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Dec 8 16:27:49 PST 2016


https://llvm.org/bugs/show_bug.cgi?id=31326

            Bug ID: 31326
           Summary: Typo correction crash with pch file
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: nicolasweber at gmx.de
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org
    Classification: Unclassified

$ cat foo.h
#define __STDC_HOSTED__ "hi"
$ cat foo.c
const char* s = __STDC_HOSTED__;
const char* s = FOO;
$ bin/clang -cc1 -emit-pch -o foo.h.pch foo.h 
foo.h:1:9: warning: '__STDC_HOSTED__' macro redefined
#define __STDC_HOSTED__ "hi"
        ^
<built-in>:307:9: note: previous definition is here
#define __STDC_HOSTED__ 1
        ^
1 warning generated.
$ bin/clang -cc1 -include-pch foo.h.pch foo.c -emit-llvm -o -
foo.c:2:13: error: redefinition of 's'
const char* s = FOO;
            ^
foo.c:1:13: note: previous definition is here
const char* s = __STDC_HOSTED__;
            ^
Assertion failed: (DelayedTypos.empty() && "Uncorrected typos!"), function
~Sema, file /Users/thakis/src/llvm-rw/tools/clang/lib/Sema/Sema.cpp, line 286.
0  clang                    0x00000001025587f6 SignalHandler(int) + 406
1  libsystem_platform.dylib 0x00007fff97f7ef1a _sigtramp + 26
Stack dump:
0.    Program arguments: bin/clang -cc1 -include-pch foo.h.pch foo.c -emit-llvm
-o - 
Abort trap: 6

-- 
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/20161209/6fb29009/attachment.html>


More information about the llvm-bugs mailing list