[llvm-bugs] [Bug 46171] New: Clang misses -Wsign-conversion warning in a simple code

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jun 2 03:41:59 PDT 2020


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

            Bug ID: 46171
           Summary: Clang misses -Wsign-conversion warning in a simple
                    code
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: haoxintu at gmail.com
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

$cat test.cc
int main(){ 
    int a = 1;
    int array[a]; 
    return 0;                                                                   
}

in GCC

$g++ -Wsign-conversion test.cc
<source>: In function 'int main()':
<source>:3:15: warning: conversion to 'long unsigned int' from 'int' may change
the sign of the result [-Wsign-conversion]
    3 |     int array[a];
      |    

But there is no warnings in clang-trunk.

https://godbolt.org/z/xCQiuT

-- 
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/20200602/d1ab8b8f/attachment.html>


More information about the llvm-bugs mailing list