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

            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: unassignedclangb...@nondot.org
          Reporter: rhain...@binghamton.edu
                CC: dgre...@apple.com, llvm-bugs@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to