[llvm-bugs] [Bug 44015] New: Wconversion warning not emitted

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Nov 15 11:44:54 PST 2019


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

            Bug ID: 44015
           Summary: Wconversion warning not emitted
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: leonardchan at google.com
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

Given the following:

```
void func(uint32_t);
void func4(uint32_t x) {
  func(sizeof(x) + x);
}
```

I would expect a `-Wconversion` warning on the call since the result of the
addition is 8 bytes, but gets truncated to 4 bytes. GCC v8.3.0 gives the
warning with `-Wconversion` enabled, but ToT clang does not.

-- 
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/20191115/9499e199/attachment-0001.html>


More information about the llvm-bugs mailing list