+2015-03-01 Eric Botcazou <ebotcazou@adacore.com>
+
+ * c-ada-spec.c (is_tagged_type): Add guard for DECL_VINDEX.
+ (dump_template_types): Adjust DECL_TEMPLATE_INSTANTIATIONS and
+ DECL_TEMPLATE_RESULT emulations.
+ (dump_ada_template)): Add guard for TYPE_METHODS.
+
2015-02-27 Marek Polacek <polacek@redhat.com>
PR c/65040
return false;
for (tmp = TYPE_METHODS (type); tmp; tmp = TREE_CHAIN (tmp))
- if (DECL_VINDEX (tmp))
+ if (TREE_CODE (tmp) == FUNCTION_DECL && DECL_VINDEX (tmp))
return true;
return false;
static int
dump_ada_template (pretty_printer *buffer, tree t, int spc)
{
- /* DECL_VINDEX is DECL_TEMPLATE_INSTANTIATIONS in this context. */
- tree inst = DECL_VINDEX (t);
- /* DECL_RESULT_FLD is DECL_TEMPLATE_RESULT in this context. */
- tree result = DECL_RESULT_FLD (t);
+ /* DECL_SIZE_UNIT is DECL_TEMPLATE_INSTANTIATIONS in this context. */
+ tree inst = DECL_SIZE_UNIT (t);
+ /* This emulates DECL_TEMPLATE_RESULT in this context. */
+ struct tree_template_decl {
+ struct tree_decl_common common;
+ tree arguments;
+ tree result;
+ };
+ tree result = ((struct tree_template_decl *) t)->result;
int num_inst = 0;
/* Don't look at template declarations declaring something coming from
if (TREE_VEC_LENGTH (types) == 0)
break;
- if (!TYPE_P (instance) || !TYPE_METHODS (instance))
+ if (!RECORD_OR_UNION_TYPE_P (instance) || !TYPE_METHODS (instance))
break;
num_inst++;
+2015-03-01 Eric Botcazou <ebotcazou@adacore.com>
+
+ * g++.dg/other/dump-ada-spec-3.C: New test.
+
2015-03-01 Martin Liska <mliska@suse.cz>
* gcc.target/i386/stackalign/longlong-2.c: Omit ICF.
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-fdump-ada-spec" } */
+
+#include <iostream>
+
+using namespace std;
+
+class Base {
+ public:
+ int My_V;
+ virtual void Primitive ();
+
+ Base ();
+};
+
+void Base::Primitive () {
+ cout << "C++ Primitive " << this->My_V << "\n";
+}
+
+Base::Base () {
+}
+
+void Dispatch (Base * B) {
+ B->Primitive ();
+}
+
+/* { dg-final { cleanup-ada-spec } } */