<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 --- - clang does not allow Microsoft's __FUNCTION__, __FUNCSIG__, and __FUNCDNAME predefined macros in conditional preprocessing directives"
href="https://llvm.org/bugs/show_bug.cgi?id=31585">31585</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>clang does not allow Microsoft's __FUNCTION__, __FUNCSIG__, and __FUNCDNAME predefined macros in conditional preprocessing directives
</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>Windows NT
</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>-New Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>thonerma@synopsys.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org, sig-rnd-sat-clang-bugs@synopsys.com
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Microsoft's compiler allows the __FUNCTION__, __FUNCSIG__, and __FUNCDNAME
predefined macros to appear in conditional preprocessing directives as defined
macros:
$ cat t.cpp
#if !defined(__FUNCTION__)
#error __FUNCTION__ is not defined.
#endif
#if !defined(__FUNCSIG__)
#error __FUNCSIG__ is not defined.
#endif
#if !defined(__FUNCDNAME__)
#error __FUNCDNAME__ is not defined.
#endif
$ cl /c t.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24215.1 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
t.cpp
<no errors>
$ clang --version
clang version 3.9.0 (tags/RELEASE_390/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
...
$ clang -c -fms-extensions t.cpp
t.cpp:2:2: error: __FUNCTION__ is not defined.
#error __FUNCTION__ is not defined.
^
t.cpp:5:2: error: __FUNCSIG__ is not defined.
#error __FUNCSIG__ is not defined.
^
t.cpp:8:2: error: __FUNCDNAME__ is not defined.
#error __FUNCDNAME__ is not defined.
^
3 errors generated.</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>