arm_cde.h includes the arm_mve_types.h header, which declares some C++
overloaded functions.
There is a superfluous `extern "C"` statement in arm_cde.h, which
encompasses these functions. This means that if compiling for C++, the
overloaded functions are declared, but are declared without name
mangling. Hence all the function names are the same and we have many
conflicting declarations.
Testing Done:
Regression tested for arm-none-eabi.
gcc/ChangeLog:
2020-04-09 Matthew Malcomson <matthew.malcomson@arm.com>
* config/arm/arm_cde.h: Remove `extern "C"` when compiling for
C++.
gcc/testsuite/ChangeLog:
2020-04-09 Matthew Malcomson <matthew.malcomson@arm.com>
* g++.target/arm/cde_mve.C: New test.
+2020-04-09 Matthew Malcomson <matthew.malcomson@arm.com>
+
+ * config/arm/arm_cde.h: Remove `extern "C"` when compiling for
+ C++.
+
2020-04-09 Martin Jambor <mjambor@suse.cz>
Richard Biener <rguenther@suse.de>
#ifndef _GCC_ARM_CDE_H
#define _GCC_ARM_CDE_H 1
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdint.h>
#if defined (__ARM_FEATURE_CDE)
#endif
-#ifdef __cplusplus
-}
-#endif
-
#endif
+2020-04-09 Matthew Malcomson <matthew.malcomson@arm.com>
+
+ * g++.target/arm/cde_mve.C: New test.
+
2020-04-09 Christophe Lyon <christophe.lyon@linaro.org>
* gcc.target/arm/cmse/cmse-15.c: Use check-function-bodies.
--- /dev/null
+/* { dg-do compile } */
+/* { dg-require-effective-target arm_v8_1m_main_cde_mve_fp_ok } */
+/* { dg-add-options arm_v8_1m_main_cde_mve_fp } */
+
+/* Ensure this compiles. */
+#include "arm_cde.h"
+int foo ()
+{
+ return 1;
+}