<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Hi,<br>
        Thanks for fixing this issue:<br>
        There seem to be another issue with recent clang when printing:<br>
        cat T.h<br>
        typedef struct { } __pthread_unwind_buf_t __attribute__
      ((__aligned__));<br>
        <br>
        clang -cc1  -x c++ -fsyntax-only T.h -ast-print<br>
      struct {<br>
      } typedef __pthread_unwind_buf_t __attribute__((aligned(clang:
      /home/vvassilev/workspace/llvm-github/obj/tools/clang/lib/AST/../../include/clang/AST/AttrImpl.inc:294:
      virtual void clang::AlignedAttr::printPretty(llvm::raw_ostream
      &, const clang::PrintingPolicy &) const: Assertion
      `isalignmentExpr && alignmentExpr != nullptr' failed.<br>
      <br>
      Vassil<br>
        <br>
      On 07/23/2014 05:25 AM, Richard Smith wrote:<br>
    </div>
    <blockquote
cite="mid:CAOfiQqmdstp0FrkVJLUdhw65=DA1hbbZKe3m48e3HJmTRM0DxA@mail.gmail.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">On Tue, Jul 22, 2014 at 1:40 AM,
            Manasij Mukherjee <span dir="ltr"><<a
                moz-do-not-send="true"
                href="mailto:manasij7479@gmail.com" target="_blank">manasij7479@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>
                  <div>
                    <div>
                      <div>
                        <div>
                          <div>
                            <div>
                              <div>Hi<br>
                              </div>
                              I was experimenting with printing out
                              variadic templates with clang.<br>
                            </div>
                            I had a slight issue with how TypePrinter
                            works for function arguments in variadic
                            function templates.<br>
                            <br>
                          </div>
                          If I have this in my original source file:<br>
                          template <typename T, typename ...U><br>
                          void foo(T t,U... args)<br>
                          {<br>
                              <br>
                          }<br>
                          <br>
                        </div>
                        TypePrinter currently generates this:<br>
                        U args...<br>
                      </div>
                      which should have been<br>
                    </div>
                    U... args<br>
                  </div>
                  as far as I know.<br>
                  <br>
                </div>
                <div>Is there some policy I can set to change this
                  behaviour?<br>
                  <br>
                </div>
                <div>I had to slightly modify the the implementation to
                  get what I expected.<br>
                  <br>
                </div>
                <div>There are two functions in TypePrinter.cpp as
                  follows:<br>
                </div>
                <div>
                  <div>
                    <div>
                      <div><br>
                        void TypePrinter::printPackExpansionBefore(const
                        PackExpansionType *T, <br>
                                                                  
                        raw_ostream &OS) {<br>
                          printBefore(T->getPattern(), OS);<br>
                          OS << "...";<br>
                        }<br>
                        void TypePrinter::printPackExpansionAfter(const
                        PackExpansionType *T, <br>
                                                                 
                        raw_ostream &OS) {<br>
                        <br>
                            printAfter(T->getPattern(), OS);<br>
                        <br>
                        }<br>
                        <br>
                      </div>
                      <div>The line:<br>
                        <br>
                      </div>
                      <div>OS << "...";<br>
                        <br>
                      </div>
                      <div>was previously in printPackExpansionAfter.<br>
                        <br>
                      </div>
                      <div>Why ?<br>
                      </div>
                      <div>Any side effects of moving it to the before
                        function, as I did ?</div>
                    </div>
                  </div>
                </div>
              </div>
            </blockquote>
            <div><br>
            </div>
            <div>Yes. That'll break pretty-printing of template type
              argument packs:</div>
            <div><br>
            </div>
            <div>template<typename ...T> void f() {</div>
            <div>  std::tuple<T[3] ...> t;</div>
            <div>}</div>
            <div><br>
            </div>
            <div>... would get pretty-printed as</div>
            <div><br>
            </div>
            <div>
              <div>  std::tuple<T ...[3]> t;</div>
            </div>
            <div><br>
            </div>
            <div>... which is wrong.</div>
            <div><br>
            </div>
            <div>Fixed in r213718.</div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
cfe-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>