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: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to