[PATCH] D47291: Proposal to make rtti errors more generic.

Sunil Srivastava via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 5 14:10:25 PDT 2018


Sunil_Srivastava updated this revision to Diff 150038.
Sunil_Srivastava added a comment.

Changed as per Paul's suggestion.


https://reviews.llvm.org/D47291

Files:
  include/clang/Basic/DiagnosticSemaKinds.td
  test/SemaCXX/no-rtti.cpp


Index: test/SemaCXX/no-rtti.cpp
===================================================================
--- test/SemaCXX/no-rtti.cpp
+++ test/SemaCXX/no-rtti.cpp
@@ -6,7 +6,7 @@
 
 void f()
 {
-  (void)typeid(int); // expected-error {{cannot use typeid with -fno-rtti}}
+  (void)typeid(int); // expected-error {{use of typeid requires -frtti}}
 }
 
 namespace {
@@ -20,7 +20,7 @@
 }
 
 bool isa_B(A *a) {
-  return dynamic_cast<B *>(a) != 0; // expected-error {{cannot use dynamic_cast with -fno-rtti}}
+  return dynamic_cast<B *>(a) != 0; // expected-error {{use of dynamic_cast requires -frtti}}
 }
 
 void* getMostDerived(A* a) {
Index: include/clang/Basic/DiagnosticSemaKinds.td
===================================================================
--- include/clang/Basic/DiagnosticSemaKinds.td
+++ include/clang/Basic/DiagnosticSemaKinds.td
@@ -6607,9 +6607,9 @@
   "no %select{struct|interface|union|class|enum}0 named %1 in %2">;
 
 def err_no_typeid_with_fno_rtti : Error<
-  "cannot use typeid with -fno-rtti">;
+  "use of typeid requires -frtti">;
 def err_no_dynamic_cast_with_fno_rtti : Error<
-  "cannot use dynamic_cast with -fno-rtti">;
+  "use of dynamic_cast requires -frtti">;
 
 def err_cannot_form_pointer_to_member_of_reference_type : Error<
   "cannot form a pointer-to-member to member %0 of reference type %1">;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47291.150038.patch
Type: text/x-patch
Size: 1331 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180605/fcacabf3/attachment-0001.bin>


More information about the cfe-commits mailing list