[LLVMbugs] [Bug 10573] New: CXXOperatorNames flag overwritten

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Aug 2 15:40:42 PDT 2011


http://llvm.org/bugs/show_bug.cgi?id=10573

           Summary: CXXOperatorNames flag overwritten
           Product: clang
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: andy.arvanitis at gmail.com
                CC: llvmbugs at cs.uiuc.edu


This flag gets set for the OpenCL language (and possibly others in the future),
and then gets overwritten a few lines later. Code is in file
lib/Frontend/CompilerInvokation.cpp. Bug is specifically here (last line
below):

------- snip ---------

  // OpenCL has some additional defaults.
  if (LangStd == LangStandard::lang_opencl) {
    Opts.OpenCL = 1;
    Opts.AltiVec = 1;
    Opts.CXXOperatorNames = 1;          <--------- set here
    Opts.LaxVectorConversions = 1;
    Opts.DefaultFPContract = 1;
  }

  if (LangStd == LangStandard::lang_cuda)
    Opts.CUDA = 1;

  // OpenCL and C++ both have bool, true, false keywords.
  Opts.Bool = Opts.OpenCL || Opts.CPlusPlus;

  Opts.GNUKeywords = Opts.GNUMode;
  Opts.CXXOperatorNames = Opts.CPlusPlus;    <------ overwritten here

----- snip ------- 

It should be something like:

  if (Opts.CPlusPlus)
    Opts.CXXOperatorNames = 1;

I actually submitted a patch for this back in April, but it didn't get picked
up.

Thanks

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list