[llvm-bugs] [Bug 26383] QualType::print prints "&" when PrintingPolicy.SuppressSpecifiers is true for reference types

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Feb 1 15:36:23 PST 2016


https://llvm.org/bugs/show_bug.cgi?id=26383

Richard Smith <richard-llvm at metafoo.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #6 from Richard Smith <richard-llvm at metafoo.co.uk> ---
(In reply to comment #5)
> What I mean is that I want to only skip the specifiers of the function.
> About what I want, I've already explained - I want to explicitly instantiate
> functions of template types:
> 
> template const QString & QList<QString>::first() const;

Here, 'const' and 'QString' are both specifiers, so you'll need to produce
those somehow. One possibility would be:

 1) print the declaration with SuppressSpecifiers = true
 2) get the function's return type and print it to a string stream with a
marker string for the declared name:
      FD->getType()->castAs<FunctionProtoType>()->getReturnType().print(Out,
Policy, "<<<MARKER>>>");
 3) take the string from step 2, remove the marker and everything after it, and
glue that on the start of the declaration from step 1.

In any case, I'm closing this bug as invalid, as SuppressSpecifiers is working
as intended.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160201/1f94913f/attachment.html>


More information about the llvm-bugs mailing list