Skip to content
Snippets Groups Projects
Unverified Commit 9aa411a7 authored by Guilhem Saurel's avatar Guilhem Saurel Committed by GitHub
Browse files

break circular include (#237)

* include registration: add failing unit test

* include registration: break circular include loop

otherwise, when a user include directly this header without fwd.hpp, as
in the include.cpp regression test:

Dans le fichier inclus depuis ../include/eigenpy/fwd.hpp:35,
                 depuis ../include/eigenpy/registration.hpp:9,
                 depuis ../unittest/include.cpp:7:
../include/eigenpy/expose.hpp: Dans la fonction « void eigenpy::expose() »:
../include/eigenpy/expose.hpp:27:9: erreur: « register_symbolic_link_to_registered_type » n'a pas été déclaré dans cette portée
   27 |     if(!register_symbolic_link_to_registered_type<T>())
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../include/eigenpy/expose.hpp:27:52: erreur: expected primary-expression before « > » token
   27 |     if(!register_symbolic_link_to_registered_type<T>())
      |                                                    ^
../include/eigenpy/expose.hpp:27:50: attention: le non logique est toujours appliqué au membre de gauche de la comparaison [-Wlogical-not-parentheses]
   27 |     if(!register_symbolic_link_to_registered_type<T>())
      |                                                  ^
../include/eigenpy/expose.hpp:27:54: erreur: expected primary-expression before « ) » token
   27 |     if(!register_symbolic_link_to_registered_type<T>())
      |                                                      ^
parent ecd138d8
No related branches found
No related tags found
No related merge requests found
Pipeline #14816 passed with warnings
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
* Copyright 2018-2019, INRIA * Copyright 2018-2019, INRIA
*/ */
#include "eigenpy/fwd.hpp"
#ifndef __eigenpy_registration_hpp__ #ifndef __eigenpy_registration_hpp__
#define __eigenpy_registration_hpp__ #define __eigenpy_registration_hpp__
#include "eigenpy/fwd.hpp"
namespace eigenpy namespace eigenpy
{ {
/// ///
......
...@@ -29,6 +29,7 @@ ADD_LIB_UNIT_TEST(matrix) ...@@ -29,6 +29,7 @@ ADD_LIB_UNIT_TEST(matrix)
ADD_LIB_UNIT_TEST(geometry) ADD_LIB_UNIT_TEST(geometry)
ADD_LIB_UNIT_TEST(complex) ADD_LIB_UNIT_TEST(complex)
ADD_LIB_UNIT_TEST(return_by_ref) ADD_LIB_UNIT_TEST(return_by_ref)
ADD_LIB_UNIT_TEST(include)
IF(NOT ${EIGEN3_VERSION} VERSION_LESS "3.2.0") IF(NOT ${EIGEN3_VERSION} VERSION_LESS "3.2.0")
ADD_LIB_UNIT_TEST(eigen_ref) ADD_LIB_UNIT_TEST(eigen_ref)
ENDIF() ENDIF()
......
/*
* Copyright 2021, CNRS
*/
// Including this header should not raise a build error
#include "eigenpy/registration.hpp"
BOOST_PYTHON_MODULE(include) {}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment