<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none"><!-- p { margin-top: 0px; margin-bottom: 0px; }--></style>
</head>
<body dir="ltr" style="font-size:10pt;color:#000000;background-color:#FFFFFF;font-family:Tahoma,Geneva,sans-serif;">
<p>Hi, <br>
</p>
<p><br>
</p>
<p>I'm using clang libraries to parse the input code below. </p>
<p><br>
</p>
<p>I call getAsString on the QualType for the return value of Real::Get() and get:<br>
</p>
<p> Test2::Thing<Zoo>*<br>
</p>
<p><br>
</p>
<p>This is wrong, it should return:<br>
</p>
<p><span style="font-family: Tahoma, Geneva, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255);"> Test2::Thing<<span style="background-color: rgb(255, 255, 0);">Test1::</span>Zoo>*</span><br>
</p>
<p><span style="font-family: Tahoma, Geneva, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255);"><br>
</span></p>
<p><span style="font-family: Tahoma, Geneva, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255);">I've stepped through the typePrinter code. Test2::Thing is an elaborated type, and TypePrinter::printElaboratedBefore turns off the scope printing
when it prints the template arguments. This results in Test1::Zoo being printed without any scope, hence the bug.</span></p>
<p><span style="font-family: Tahoma, Geneva, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255);"><br>
</span></p>
<p><span style="font-family: Tahoma, Geneva, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255);">Is this a known issue and any thoughts on a workaround?</span></p>
<p><br>
</p>
<p>Sample code:<br>
</p>
<p><br>
</p>
<div><span style="font-family: 'Courier New', monospace;">namespace Test1 { </span><span style="font-size: 10pt; font-family: 'Courier New', monospace;"><span style="font-family: 'Courier New', monospace;">struct Zoo; </span></span><span style="font-size: 10pt; font-family: 'Courier New', monospace;"><span style="font-family: 'Courier New', monospace;">}</span></span></div>
<div><br style="font-family: 'Courier New', monospace;">
</div>
<div><span style="font-family: 'Courier New', monospace;">namespace Test2 {</span></div>
<div><br style="font-family: 'Courier New', monospace;">
</div>
<div><span style="font-family: 'Courier New', monospace;"> template<typename T></span></div>
<div><span style="font-family: 'Courier New', monospace;"> struct Thing </span><span style="font-size: 10pt; font-family: 'Courier New', monospace;"><span style="font-family: 'Courier New', monospace;">{</span></span><span style="font-size: 10pt; font-family: 'Courier New', monospace;"><span style="font-family: 'Courier New', monospace;">};</span></span></div>
<div><br style="font-family: 'Courier New', monospace;">
</div>
<div><span style="font-family: 'Courier New', monospace;"> template<typename T></span></div>
<div><span style="font-family: 'Courier New', monospace;"> struct Base</span></div>
<div><span style="font-family: 'Courier New', monospace;"> {</span><br style="font-family: 'Courier New', monospace;">
</div>
<div><span style="font-family: 'Courier New', monospace;"> virtual Test2::Thing<T>* Get() = 0;</span></div>
<div><span style="font-family: 'Courier New', monospace;"> };</span><br style="font-family: 'Courier New', monospace;">
</div>
<div><br style="font-family: 'Courier New', monospace;">
</div>
<div><span style="font-family: 'Courier New', monospace;"> struct Real : public Base < Test1::Zoo ></span></div>
<div><span style="font-family: 'Courier New', monospace;"> {</span></div>
<div><span style="font-family: 'Courier New', monospace;"> };</span></div>
<div><br style="font-family: 'Courier New', monospace;">
</div>
<div><span style="font-family: 'Courier New', monospace;">}</span></div>
<div><br>
Thanks,</div>
<div>-dan<br>
</div>
</body>
</html>