<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi,<br>
    <br>
    We also discovered that we could not find in clang a routine that
    reliably generate the name (or the equivalent<br>
    decl/type) corresponding to a type as it would need to be typed from
    the global namespace (i.e. a unique identifier<br>
    of the class); for example the naming routine that can be tuned to
    give a fully qualified name often do not reliably handle the <br>
    nested template parameters (similar to what Sterling also found
    out).<br>
    <br>
    Cheers,<br>
    Philippe.<br>
    <br>
    PS. As an aside the code we have in cling/lib/Utils/AST.cpp does a
    bit more as it can drop some<br>
    of the template parameters when they are defaulted and keep some
    typedef (for example std::string).<br>
    The goal is to produce a 'normalized name' that is platform
    independent and suitable to use<br>
    as a persistent representation of the class;   This is used as part
    of ROOT I/O which enables storing<br>
    arbitrary C++ objects in files that can be read on multiple
    platforms and can be read even when<br>
    the class' schema changes.   This used to store many petabytes of
    experimental data that needs to <br>
    be read very quickly and need to also be readable many years later.<br>
    <br>
    <div class="moz-cite-prefix">On 10/13/15 4:01 PM, Sterling Augustine
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAEG7qUwVWad-rnfQJ0vKhz4f533eq4AD7SV-60SyknQUh4e_0A@mail.gmail.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">On Tue, Oct 13, 2015 at 1:33 PM,
            David Blaikie <span dir="ltr"><<a moz-do-not-send="true"
                href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@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">
              <div dir="ltr">
                <div class="gmail_extra">
                  <div class="gmail_quote"><span class="">
                      <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">
                        <div dir="ltr">
                          <div style="font-size:12.8px"><br>
                          </div>
                          <div style="font-size:12.8px"><a
                              moz-do-not-send="true"
href="https://root.cern.ch/gitweb?p=root.git;a=blob;f=interpreter/cling/lib/Utils/AST.cpp"
                              target="_blank"><a class="moz-txt-link-freetext" href="https://root.cern.ch/gitweb?p=root.git;a=blob;f=interpreter/cling/lib/Utils/AST.cpp">https://root.cern.ch/gitweb?p=root.git;a=blob;f=interpreter/cling/lib/Utils/AST.cpp</a></a><br>
                          </div>
                          <div style="font-size:12.8px"><br>
                          </div>
                          <div style="font-size:12.8px">Does it makes
                            sense to upstream this functionality from
                            cling into clang? <br>
                          </div>
                        </div>
                      </blockquote>
                      <div><br>
                      </div>
                    </span>
                    <div>Presumably clang needs to do this in places
                      already (diagnostic messages, etc?)? Have you
                      found any instances of that? Is there existing
                      code doing that work that could be refactored into
                      something reusable (that way it's being actually
                      executed and tested within Clang's many codepaths,
                      which is helpful to avoid bitrot, etc)</div>
                  </div>
                </div>
              </div>
            </blockquote>
            <div><br>
            </div>
            <div>To the best of my knowledge, it doesn't exist.
              Certainly not in diagnostics, which try to reproduce what
              the user wrote, rather than what they would need to write
              in general. (In particular, things like
              template_A<nested_type_0,
              template_B<nested_type_1>> seem to never have
              sub-types get fully expanded. I've looked for this in
              clang, and it is possible I missed something, so happy for
              any pointers.</div>
            <div><br>
            </div>
            <div>Clang is oriented to reproducing the source code as
              written, not what one would need to write to access it
              from a random namespace.</div>
            <div><br>
            </div>
            <div>This is one of several bits of functionality where the
              comment in my code is: "one would think this is
              implemented somewhere in clang, but one would be wrong".
              (Generic fully-qualified lookup being another. Also
              implemented in cling, but is not very complicated, so not
              as big of a deal as this.)</div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
  </body>
</html>