<html>
<head>
<base href="https://bugs.llvm.org/">
</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 - Invalid error on long long literal -9223372036854775808LL as a long long array value"
href="https://bugs.llvm.org/show_bug.cgi?id=47295">47295</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Invalid error on long long literal -9223372036854775808LL as a long long array value
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>6.0
</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>C++
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>francis.andre.kampbell@orange.fr
</td>
</tr>
<tr>
<th>CC</th>
<td>blitzrakete@gmail.com, dgregor@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>Hello
Compiling the sample below;
static const long long jjlonglong = -9223372036854775808LL;
static const long long jjlonglong1 = 0xFFFFFFFFFFFFFFFF;
static const long long jjCharData[][41] = {
{2LL, 1LL, -9223372036854775808LL}
};
int main() {
return 0;
}
Clang is producing those messages
x.cpp:2:38: warning: integer literal is too large to be represented in a signed
integer type, interpreting as unsigned [-Wimplicitly-unsigned-literal]
static const long long jjlonglong = -9223372036854775808LL;
^
x.cpp:6:14: warning: integer literal is too large to be represented in a signed
integer type, interpreting as unsigned [-Wimplicitly-unsigned-literal]
{2LL, 1LL, -9223372036854775808LL}
^
x.cpp:6:13: error: constant expression evaluates to 9223372036854775808 which
cannot be narrowed to type 'long long' [-Wc++11-narrowing]
{2LL, 1LL, -9223372036854775808LL}
^~~~~~~~~~~~~~~~~~~~~~
x.cpp:6:13: note: insert an explicit cast to silence this issue
{2LL, 1LL, -9223372036854775808LL}
^~~~~~~~~~~~~~~~~~~~~~
static_cast<long long>( )
The same long long literal as -9223372036854775808LL should produce the same
warning, be used as initializer of a simple variable or a long long array
member.</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>