Handle DECL_OMP_DECLARE_REDUCTION in discriminator_for_local_entity
2016-02-08 Tom de Vries <tom@codesourcery.com>
PR c++/59627
* mangle.c (discriminator_for_local_entity): Handle
DECL_OMP_DECLARE_REDUCTION_P function.
* testsuite/libgomp.c++/udr-20.C: New test.
---
gcc/cp/mangle.c | 3 +++
libgomp/testsuite/libgomp.c++/udr-20.C | 4 ++++
2 files changed, 7 insertions(+)
@@ -1758,6 +1758,9 @@ discriminator_for_local_entity (tree entity)
return local_class_index (entity);
}
+ else if (TREE_CODE (entity) == FUNCTION_DECL
+ && DECL_OMP_DECLARE_REDUCTION_P (entity))
+ return 0;
else
gcc_unreachable ();
}
new file mode 100644
@@ -0,0 +1,4 @@
+// { dg-do run { target lto } }
+// { dg-additional-options "-flto" }
+
+#include "udr-1.C"