<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 - apparent c++ compiler issue compiling a throw statement"
href="https://bugs.llvm.org/show_bug.cgi?id=33476">33476</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>apparent c++ compiler issue compiling a throw statement
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.8
</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>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>tootall79@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>while compiling a try block compiler cannot find the correct ctor candidate,
yet it CAN find it when compiling outside the throw line.
here are 3 lines of code, the first 2 lines compiles fine, the 3rd line gives
the error shown
TString sBS("hello world");
TErrPub eFU( sBS ); // no error here
throw TErrPub( sBS ); // error here ??
the first line demonstrates the sBS, a string object, DOES have a ctor in the
TErrPub class, and the compiler finds it fine. But if you try to construct the
exact same TErrPub instance inside a throw it can't find the ctor. Here is the
error:
/media/FATSD29/Houston/wkspc/free/dev/wxhSLED/main.cpp:740:9: error: no
matching constructor for initialization of 'TErrPub'
throw TErrPub( sBS );
^~~~~~~~~~~~~~
../../../../include/TErrPub.h:15:2: note: candidate constructor not viable:
expects an l-value for 1st argument
TErrPub( TErrPub& EP );
^
../../../../include/TErrPub.h:17:2: note: candidate constructor not viable: no
known conversion from 'TErrPub' to 'TString &' for 1st argument
TErrPub( TString& sMsg );
please advise, thanks!</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>