<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 --- - [ms] type conversion with a type named with two words cannot be compiled in if statement"
href="https://llvm.org/bugs/show_bug.cgi?id=26836">26836</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[ms] type conversion with a type named with two words cannot be compiled in if statement
</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>Frontend
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>andrey.kuleshov@intel.com
</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>!- the way MS compiler works is logical and explainable, because such behavior
is user friendly.
clang can compile such line:
"if( long(t1) < t2 ) ;"
a little bit confusing for a user that this line cannot be compiled:
"if( unsigned long(t1) < t2 ) ;"
I suppose that this feature might be added to clang under fms-compability
option -!
=========Environment============
Language: c++
OS: Windows
Version: trunk
=========How to reproduce========
void f(int t1, unsigned long t2 )
{
if( unsigned long(t1) < t2 ) ;
}
=========Error===================
<span class="quote">>>> clang:</span >
error: variable declaration in condition must have an initializer
if( unsigned long(t1) < t2 ) ;
error: expected ')'
if( unsigned long(t1) < t2 ) ;
<span class="quote">>>> MSVC/intel icc compiler: no diagnostics</span >
<span class="quote">>>> gcc: </span >
error: expected primary-expression before ‘unsigned’
if( unsigned long(t1) < t2 ) ;
error: expected ‘)’ before ‘unsigned’
Andrey Kuleshov
======
Software Engineer
Intel Compiler Team</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>