2008-01-06 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/34680
* c-cppbuiltin.c (c_cpp_builtins): Define __GXX_RTTI, if appropriate.
* doc/cpp.texi ([Common Predefined Macros]): Document.
gcc/testsuite/
2008-01-06 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/34680
* g++.dg/rtti/predefined-rtti-macro-1.C: New.
* g++.dg/rtti/predefined-rtti-macro-2.C: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@131366
138bc75d-0d04-0410-961f-
82ee72b054a4
+2008-01-06 Paolo Carlini <pcarlini@suse.de>
+
+ PR libstdc++/34680
+ * c-cppbuiltin.c (c_cpp_builtins): Define __GXX_RTTI, if appropriate.
+ * doc/cpp.texi ([Common Predefined Macros]): Document.
+
2008-01-06 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.c (ix86_emit_swsqrtsf): Use negative constants in
cpp_define (pfile, "__GXX_WEAK__=0");
if (warn_deprecated)
cpp_define (pfile, "__DEPRECATED");
+ if (flag_rtti)
+ cpp_define (pfile, "__GXX_RTTI");
if (cxx_dialect == cxx0x)
cpp_define (pfile, "__GXX_EXPERIMENTAL_CXX0X__");
}
+2008-01-06 Paolo Carlini <pcarlini@suse.de>
+
+ PR libstdc++/34680
+ * g++.dg/rtti/predefined-rtti-macro-1.C: New.
+ * g++.dg/rtti/predefined-rtti-macro-2.C: Likewise.
+
2008-01-06 Paul Thomas <pault@gcc.gnu.org>
PR fortran/34545
--- /dev/null
+// { dg-do compile }
+
+struct A { virtual ~A() { }; };
+struct B : A { };
+
+void f(B* bp)
+{
+ bp =
+#ifdef __GXX_RTTI
+ dynamic_cast<B*>(static_cast<A*>(0));
+#endif
+}
--- /dev/null
+// { dg-do compile }
+// { dg-options "-fno-rtti" }
+
+struct B { };
+
+void f(B* bp)
+{
+ bp =
+#ifndef __GXX_RTTI
+ static_cast<B*>(0);
+#endif
+}