<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 --- - Segfault, multi template after non-terminated static function array w/ static function"
href="http://llvm.org/bugs/show_bug.cgi?id=22440">22440</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Segfault, multi template after non-terminated static function array w/ static function
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.5
</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>Frontend
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>8kilometers+bugzilla@gmail.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>clang crashes with segfault, the command line, preprocessed source, and run
script are attached in one file. I have all the files that caused the crash if
you need more info.
AFAICT a static array of at least 1 non-static function that is not terminated
with a semicolon and is followed by a template with 2+ arguments the second
being in another namespace causes a crash at the next delimeter
here's what I think would be most useful
1. inc/Request.hpp:51:45: current parser token '>'
the last line here is line 51, many people enjoy cookies with their meth
void methBad();
void methGet();
void methPost();
void methOptions();
void methTrace();
void methHead();//hehe
static std::function<void(Request*)> methods[] =
{
methBad,
methGet,
methPost,
methOptions,
methTrace,
methHead
}
std::unordered_map<std::string, std::string> sendCookies;
adding a semicolon after the closing brace of methods[] or changing 'void
methX()' to 'static void methX(Request* req)' causes it to work as expected and
removes to error with the former complaining about the methods not being static
and the latter complaining about the lack of a semicolon after methods[]
inc/Request.hpp:51:39: error: non-friend class member 'string' cannot have a
qualified name
std::unordered_map<std::string, std::string> sendCookies;
~~~~~^
however, adding a non-static method anywhere in the array (without the
semicolon) causes the crash again.
putting a vector<std::string> or non-templated variable before the map stops
the crash and removes the non-friend error as does replacing the value type of
the map with anything not in another namespace, the key type has no effect
adding a hash function 'std::unordered_map<std::string, std::string,
std::hash<std::string>> sendCookies;' still crashes at string and does not
crash if the second template argument is not in another namespace even if the
third is, and the same with a fourth arg. placing the class in namespace std
has no effect
inc/Request.hpp:52:40: error: non-friend class member 'string' cannot have a
qualified name
std::unordered_map<std::string, std::string,
std::hash<std::string>> sendCookies;
~~~~~^
1. inc/Request.hpp:52:46: current parser token ','
good day</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>