[llvm-bugs] [Bug 40711] New: no warning expected -Wtautological-unsigned-zero-compare

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Feb 12 17:07:27 PST 2019


https://bugs.llvm.org/show_bug.cgi?id=40711

            Bug ID: 40711
           Summary: no warning expected
                    -Wtautological-unsigned-zero-compare
           Product: clang
           Version: 7.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++'17
          Assignee: unassignedclangbugs at nondot.org
          Reporter: ankur.dedev at tuta.io
                CC: blitzrakete at gmail.com, erik.pilkington at gmail.com,
                    llvm-bugs at lists.llvm.org, richard-llvm at metafoo.co.uk

The below code compiled with '-std=c++17 -Weverything -Wno-c++98-compat' issues
a -Wtautological-unsigned-zero-compare. I do not expect any warnings.

int main()
{
  using Size_t = unsigned long;

  Size_t pos{1};

  if constexpr (sizeof(Size_t) > 0) { return 0; }
  else { return 0 <= pos ? 0 : 1; }
}

-- 
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/20190213/1e58af21/attachment.html>


More information about the llvm-bugs mailing list