<html>
<head>
<base href="http://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 --- - On Windows, #include and __has_include fails to find files when device name is not present. maybe path library is at fault."
href="http://llvm.org/bugs/show_bug.cgi?id=17361">17361</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>On Windows, #include and __has_include fails to find files when device name is not present. maybe path library is at fault.
</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>gmisocpp@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>To reproduce:
* On WINDOWS (important), create a directory named c:\test (use that name)
* Create test.h in the test directory containing the comment /* test */
* In c:\test, create the file test.cpp and copy this program into it:
#define AFILE "\test\test.h"
#if defined(__clang__)
#if __has_include( AFILE )
#warning "appears to have test.h"
#else
#warning "appears not to have test.h"
#endif
#endif
#include AFILE
int main()
{
}
* Then compile. Results are:
c:\test>clang++ test.cpp
test.cpp:7:2: warning: "appears not to have test.h" [-W#warnings]
#warning "appears not to have test.h"
^
test.cpp:11:10: fatal error: '\test\test.h' file not found
#include AFILE
^
test.cpp:1:15: note: expanded from macro 'AFILE'
#define AFILE "\test\test.h"
^
1 warning and 1 error generated.
c:\test>g++ test.cpp
c:\test>
* Note how clang++ fails to find the file. If the AFILE macro is changed to
include a drive, i.e. c:\test\test.h, the file will be found.
* Note how g++ works either way.
Conclusion: clang has a bug. Possibly in it's path library
c:\llvm\lib\Support\path.cpp or .inc or .h at a guess because __has_include and
#include are both similarly affected.</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>