[llvm-bugs] [Bug 33012] New: Suggested fix (static_cast) missing qualifier

via llvm-bugs llvm-bugs at lists.llvm.org
Thu May 11 15:45:55 PDT 2017


            Bug ID: 33012
           Summary: Suggested fix (static_cast) missing qualifier
           Product: clang
           Version: 3.9
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: rhainin1 at binghamton.edu
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org

In suggesting a static_cast to solve narrowing, clangs suggestion does not
print the fully qualified name. For example this file (ex.cpp)

namespace holds_alias {
  using MyInt = unsigned int;

struct TakesAlias {
  TakesAlias(holds_alias::MyInt) { }

TakesAlias t{-1};

The final line errors on narrowing as expected, but the suggestion note says:

ex.cpp:9:14: note: insert an explicit cast to silence this issue
TakesAlias t{-1};
             static_cast<MyInt>( )

When in fact, what is needed is static_cast<holds_alias::MyInt>

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/20170511/b43f7311/attachment-0001.html>

More information about the llvm-bugs mailing list