[PATCH] D86369: [Sema][MSVC] warn at dynamic_cast when /GR- is given

Zequan Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 21 13:55:36 PDT 2020


zequanwu added inline comments.


================
Comment at: clang/test/SemaCXX/ms_dynamic_cast.cpp:16
+    B *b = new D1();
+    auto d = dynamic_cast<D1 *>(b); // expected-warning{{should not use dynamic_cast with /GR-}}
+}
----------------
lebedev.ri wrote:
> I'm not sure it makes sense to talk about MSVC/clang-cl flags when normal clang is used.
> Either the diag should only be used in MSVC compat mode,
> or it should talk about `-fno-rtti` in non-MSVC compat mode.
I am not sure either... But `-fno-rtti-data` is only used when clang-cl driver translate `/GR-` to `-fno-rtti-data`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D86369/new/

https://reviews.llvm.org/D86369



More information about the cfe-commits mailing list