<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 - Warns about lambda function based on the return type that is not what inferred return type is"
href="https://bugs.llvm.org/show_bug.cgi?id=50003">50003</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Warns about lambda function based on the return type that is not what inferred return type is
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>10.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>FreeBSD
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>C++11
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>yuri@tsoft.com
</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>Created <span class=""><a href="attachment.cgi?id=24762" name="attach_24762" title="testcase-clang-bug-warns-about-fantom-return.cpp">attachment 24762</a> <a href="attachment.cgi?id=24762&action=edit" title="testcase-clang-bug-warns-about-fantom-return.cpp">[details]</a></span>
testcase-clang-bug-warns-about-fantom-return.cpp
The lambda function is written like it returns char* but the inferred return
type is std::string.
clang-10 warns:
<span class="quote">> testcase-clang-bug-warns-about-fantom-return.cpp:14:11: warning: address of stack memory associated with local variable 't' returned [-Wreturn-stack-address]
> return t;
> ^
> 1 warning generated.</span >
as if this function returns char*, but the actual correct inferred return type
is std::string and there should be no warning.</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>