<html>
<head>
<base href="https://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Redefining __DATE__ or __TIME__ with pch causes Assertion failed: (!StoredMD.getLatest() && "the macro history was modified before initializing it from a pch")"
href="https://llvm.org/bugs/show_bug.cgi?id=29119">29119</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Redefining __DATE__ or __TIME__ with pch causes Assertion failed: (!StoredMD.getLatest() && "the macro history was modified before initializing it from a pch")
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Frontend
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>nicolasweber@gmx.de
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>$ cat header-pch.h # empty file
$ cat main.c
const char* s = __DATE__ " " __TIME__;
$ ~/src/llvm-build/bin/clang -D__DATE__= -D__TIME__= header-pch.h -o header.pch
-w
$ ~/src/llvm-build/bin/clang -D__DATE__= -D__TIME__= -include-pch header.pch -c
main.c
Assertion failed: (!StoredMD.getLatest() && "the macro history was modified
before initializing it from a pch"), function setLoadedMacroDirective, file
/Users/thakis/src/llvm-rw/tools/clang/lib/Lex/PPMacroExpansion.cpp, line 74.
Stack dump:
0. Program arguments: /Users/thakis/src/llvm-build/bin/clang-3.5 -cc1
-triple x86_64-apple-macosx10.10.0 -Wdeprecated-objc-isa-usage
-Werror=deprecated-objc-isa-usage -emit-obj -mrelax-all -disable-free
-main-file-name main.c -mrelocation-model pic -pic-level 2 -mthread-model posix
-mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2
-target-linker-version 253.3 -dwarf-column-info -debugger-tuning=lldb
-coverage-file /Users/thakis/Downloads/reduced_clang_crash/main.c -resource-dir
/Users/thakis/src/llvm-build/bin/../lib/clang/4.0.0 -include-pch header.pch -D
__DATE__= -D __TIME__= -fdebug-compilation-dir
/Users/thakis/Downloads/reduced_clang_crash -ferror-limit 19 -fmessage-length
248 -stack-protector 1 -fblocks -fobjc-runtime=macosx-10.10.0
-fencode-extended-block-signature -fmax-type-align=16 -fdiagnostics-show-option
-fcolor-diagnostics -o main.o -x c main.c
1. main.c:1:17: current parser token '__DATE__'
clang-3.5: error: unable to execute command: Abort trap: 6
clang-3.5: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 4.0.0 (trunk 279499)
Target: x86_64-apple-darwin14.5.0
Thread model: posix
InstalledDir: /Users/thakis/src/llvm-build/bin
clang-3.5: note: diagnostic msg: PLEASE submit a bug report to
<a href="http://llvm.org/bugs/">http://llvm.org/bugs/</a> and include the crash backtrace, preprocessed source, and
associated run script.
clang-3.5: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-3.5: note: diagnostic msg:
/var/folders/c5/8d7sdn1x2mg92mj0rndghhdr0000gn/T/main-65d9dd.c
clang-3.5: note: diagnostic msg:
/var/folders/c5/8d7sdn1x2mg92mj0rndghhdr0000gn/T/main-65d9dd.sh
clang-3.5: note: diagnostic msg:
********************</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>