<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 --- - Default value for std::map in a class method doesn't compile"
href="http://llvm.org/bugs/show_bug.cgi?id=18153">18153</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Default value for std::map in a class method doesn't compile
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.3
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</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>QAPlatformExt@barclays.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>Created <span class=""><a href="attachment.cgi?id=11674" name="attach_11674" title="Sample code">attachment 11674</a> <a href="attachment.cgi?id=11674&action=edit" title="Sample code">[details]</a></span>
Sample code
The following declaration
class Foo {
double bar(const std::map<int, int>& baz = std::map<int,int>());
};
causes Clang 3.3. to issue a compilation error:
error: expected ')'
double bar(const std::map<int, int>& baz = std::map<int,int>());
^
note: to match this '('
double bar(const std::map<int, int>& baz = std::map<int,int>());
^
error: expected '>'
double bar(const std::map<int, int>& baz = std::map<int,int>());
^
2 errors generated.
Compilation failed
See the attached file for more examples.
The same code compiles correctly in Visual Studio 2012 on Windows and with GCC
4.8.1 on Linux.
Note that std::map and std::vector were used as an example only. It seems that
any other one- and two-parameter template leads to the same error.</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>