<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 8/10/15 3:54 PM, Peter Finn via
      llvm-dev wrote:<br>
    </div>
    <blockquote
      cite="mid:97406F89-842F-47EC-9000-39402A2451B2@icloud.com"
      type="cite">
      <meta http-equiv="Context-Type" content="text/html; charset=utf-8">
      I’ve been updating SAFECode files to work with LLVM 3.7, and I’ve
      run into a number of errors I can’t explain.</blockquote>
    <br>
    You might want to see if the "const" qualifier is causing the
    problem.  The ostream is a basic_ostream<char> while the
    string you're passing is a "const char".<br>
    <br>
    Regarding the comment about using LLVM's stream classes, the code
    you're working on is a runtime library linked into applications and
    is not an LLVM compiler pass.  Therefore, using std::ostream should
    be fine (at least, it shouldn't be the cause of the problem).<br>
    <br>
    Regards,<br>
    <br>
    John Criswell<br>
    <blockquote
      cite="mid:97406F89-842F-47EC-9000-39402A2451B2@icloud.com"
      type="cite">
      <div class=""><br class="">
      </div>
      <div class="">
        <div class="">In
          LLVM_SRC/projects/safecode/runtime/BBRuntime/DebugReport.cpp,
          there are a host of std::ostream objects that, when given
          strings with the “<<“ operator, produce errors.  Also,
          the compiler doesn’t seem to recognize std::dec for some
          reason.  Here is a sample of the errors I’m getting:</div>
        <div class=""><br class="">
        </div>
        <div class="">
          <div class=""><b class="">/Users/peterfinn/Desktop/llvm_trunk_2/projects/safecode/runtime/BBRuntime/DebugReport.cpp:30:6: </b><span
              class=""><b class="">error: </b></span><b class="">invalid
              operands to binary expression</b></div>
          <div class=""><b class="">      ('std::ostream' (aka
              'basic_ostream<char>') and 'const char *')</b></div>
          <div class="">  OS << "= Fault PC Source                
                  :\t"</div>
          <div class=""><b class="">  ~~ ^ 
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</b></div>
          <div class=""><b class="">/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:5263:1:
              note: </b>candidate template ignored: could not match</div>
          <div class="">      'shared_ptr<type-parameter-0-2>'
            against 'char const[43]'</div>
          <div class="">operator<<(basic_ostream<_CharT,
            _Traits>& __os, shared_ptr<_Yp> const&
            __p);</div>
          <div class=""><b class="">^</b></div>
          <div class=""><b class="">/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:4191:1:
              note: </b>candidate template ignored: could not match</div>
          <div class="">      'basic_string<type-parameter-0-0,
            type-parameter-0-1, type-parameter-0-2>' against 'char
            const[43]'</div>
          <div class="">operator<<(basic_ostream<_CharT,
            _Traits>& __os,</div>
          <div class=""><b class="">^</b></div>
          <div class=""><b class="">/Users/peterfinn/Desktop/llvm_trunk_2/projects/safecode/runtime/BBRuntime/DebugReport.cpp:32:20: </b><span
              class=""><b class="">error: </b></span><b class="">no
              member named 'dec' in namespace 'std'</b></div>
          <div class="">    << ":" << std::dec <<
            this->lineNo << "\n";</div>
          <div class=""><b class="">              ~~~~~^</b></div>
          <div class=""><b class="">/Users/peterfinn/Desktop/llvm_trunk_2/projects/safecode/runtime/BBRuntime/DebugReport.cpp:38:6: </b><span
              class=""><b class="">error: </b></span><b class="">invalid
              operands to binary expression</b></div>
          <div class=""><b class="">      ('std::ostream' (aka
              'basic_ostream<char>') and 'const char *')</b></div>
          <div class="">  OS << "= Pool Handle                    
                  :\t" << this->PoolHandle << "\n";</div>
          <div class=""><b class="">  ~~ ^ 
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</b></div>
          <div class=""><b class="">/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:5263:1:
              note: </b>candidate template ignored: could not match</div>
          <div class="">      'shared_ptr<type-parameter-0-2>'
            against 'char const[43]'</div>
          <div class="">operator<<(basic_ostream<_CharT,
            _Traits>& __os, shared_ptr<_Yp> const&
            __p);</div>
          <div class=""><b class="">^</b></div>
          <div class=""><b class="">/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:4191:1:
              note: </b>candidate template ignored: could not match</div>
          <div class="">      'basic_string<type-parameter-0-0,
            type-parameter-0-1, type-parameter-0-2>' against 'char
            const[43]'</div>
          <div class="">operator<<(basic_ostream<_CharT,
            _Traits>& __os,</div>
          <div class=""><b class="">^</b></div>
        </div>
        <div class=""><b class=""><br class="">
          </b></div>
        <div class="">I’ve been trying to find information online, but
          I’ve found nothing helpful.  I tried creating my own test
          programs, with my own std::ostream objects, but I couldn’t
          recreate the errors.  Do you have any idea what could be
          causing this problem?</div>
        <div class=""><br class="">
        </div>
        <div class="">Thanks,</div>
        <div class="">Peter Finn</div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>         <a class="moz-txt-link-freetext" href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
John Criswell
Assistant Professor
Department of Computer Science, University of Rochester
<a class="moz-txt-link-freetext" href="http://www.cs.rochester.edu/u/criswell">http://www.cs.rochester.edu/u/criswell</a></pre>
  </body>
</html>