<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 --- - rejects-valid with trailing return type on function-returning-function"
href="http://llvm.org/bugs/show_bug.cgi?id=16771">16771</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>rejects-valid with trailing return type on function-returning-function
</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>Linux
</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++11
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>richard-llvm@metafoo.co.uk
</td>
</tr>
<tr>
<th>CC</th>
<td>dgregor@apple.com, llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre><stdin>:1:1: error: 'auto' return without trailing return type
auto (*f())() -> int;
^
This appears to be valid in C++1y, and maybe in C++11 too. (*f()) is a
noptr-declarator, so this conforms to the grammar. In 8.3.5p2, we have
D1 = (*f())
T = auto
and the type of the contained declarator-id in the declaration T D1 is
"function of () returning pointer to auto", and T is the single type-specifier
'auto', so this doesn't violate 8.3.5p2's restrictions, and gives f the type
"function of () returning pointer to function of () returning int".
In C++11, the declaration "T D1" is ill-formed by 7.1.6.4p2, because the auto
type-specifier did not appear with a trailing-return-type. It's not obvious
whether that makes the original declaration ill-formed; both EDG and g++ accept
it.</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>