-
- Downloads
Add a -Wclass-varargs to warn on objects of any class type being passed...
Add a -Wclass-varargs to warn on objects of any class type being passed through an ellipsis. Since C++11 relaxed the rules on this, we allow a lot more bad code through silently, such as: const char *format = "%s"; std::experimental::string_view view = "foo"; printf(format, view); In this case, not only warn about a class type being used here, but also suggest that calling c_str() might be a good idea. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202461 91177308-0d34-0410-b5e6-96231b3b80d8
Showing
- include/clang/Basic/DiagnosticGroups.td 1 addition, 0 deletionsinclude/clang/Basic/DiagnosticGroups.td
- include/clang/Basic/DiagnosticSemaKinds.td 5 additions, 0 deletionsinclude/clang/Basic/DiagnosticSemaKinds.td
- include/clang/Sema/Sema.h 3 additions, 0 deletionsinclude/clang/Sema/Sema.h
- lib/Sema/SemaChecking.cpp 21 additions, 6 deletionslib/Sema/SemaChecking.cpp
- lib/Sema/SemaExpr.cpp 10 additions, 4 deletionslib/Sema/SemaExpr.cpp
- test/SemaCXX/vararg-class.cpp 48 additions, 0 deletionstest/SemaCXX/vararg-class.cpp
Loading
Please register or sign in to comment