<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">When I add the 'template' keyword as
suggested clang gives me the very same error. g++ still eats it
without problem.<br>
<br>
Am 08.10.2013 18:23, schrieb David Blaikie:<br>
</div>
<blockquote
cite="mid:CAENS6EtWstKG5tf1f6WpM3dGQdpdnkRLquTx2MOx5iwLQmsOfg@mail.gmail.com"
type="cite">
<div dir="ltr"><br>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Tue, Oct 8, 2013 at 8:36 AM,
Daniel Schwalbe <span dir="ltr"><<a
moz-do-not-send="true" href="mailto:dansch491@gmail.com"
target="_blank">dansch491@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi,<br>
<br>
I don't know if I encountered a compiler bug in clang 3.3
or if this is one of the many subtle c++ exceptional
cases:<br>
<br>
When I try to compile the attached file (using: clang++
-std=c++11 test.cpp) I receive a compiler error:<br>
<br>
"test.cpp:15:42: error: identifier 'SmartPtrType' in
object destruction expression does not name a type<br>
~SmartUnion() {m_sptr.SmartPtrType<T>::~SmartPtrType();
}"<br>
<br>
g++ compiles the file without problem.<br>
<br>
clang compiles it, too, if I explicitly introduce a
typedef for SmartPtrType<T> and call this typedef
name instead:<br>
<br>
typedef SmartPtrType<T> smartptr_type;<br>
~SmartUnion() {m_sptr.smartptr_type::~smartptr_type(); }<br>
<br>
Is this a subtle language feature or a compiler bug?</blockquote>
<div><br>
</div>
<div>I believe this is a language feature because the
expression is ambiguous if m_sptr is type dependent (which
I assume it is)<br>
<br>
The other solution, rather than introducing a typedef, is
to use the 'template' keyword:<br>
<br>
~SmartUnion() {m_sptr.template SmartPtrType<T>::~SmartPtrType();
}<br>
</div>
<div> </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span
class=""><font color="#888888"><br>
<br>
Daniel<br>
<br>
<br>
<br>
</font></span><br>
_______________________________________________<br>
cfe-users mailing list<br>
<a moz-do-not-send="true"
href="mailto:cfe-users@cs.uiuc.edu">cfe-users@cs.uiuc.edu</a><br>
<a moz-do-not-send="true"
href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-users"
target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-users</a><br>
<br>
</blockquote>
</div>
<br>
</div>
</div>
</blockquote>
<br>
</body>
</html>