[LLVMbugs] [Bug 20735] New: wrong fixit hint for -Wparentheses followed by qualified-id

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Aug 22 16:53:59 PDT 2014


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

            Bug ID: 20735
           Summary: wrong fixit hint for -Wparentheses followed by
                    qualified-id
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: richard-llvm at metafoo.co.uk
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu,
                    rtrieu at google.com
    Classification: Unclassified

lib/Sema/SemaDecl.cpp:10867:24: warning: & has lower precedence than !=; !=
will be evaluated first [-Wparentheses]
  while (S->getFlags() & Scope::TemplateParamScope != 0)
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/Sema/SemaDecl.cpp:10867:24: note: place parentheses around the '!='
expression to silence this warning
  while (S->getFlags() & Scope::TemplateParamScope != 0)
                       ^
                         (                             )
lib/Sema/SemaDecl.cpp:10867:24: note: place parentheses around the & expression
to evaluate it first
  while (S->getFlags() & Scope::TemplateParamScope != 0)
                       ^
         (                    )

Note that the final fix-it hint is suggesting putting the close paren in the
wrong place. Are we incorrectly assuming that the middle expression is only a
single token long here, or is the source range for that expression wrong?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140822/6a8fb46b/attachment.html>


More information about the llvm-bugs mailing list