Refactoring patches

Enrico Forestieri forenr at lyx.org
Fri Oct 23 11:30:15 UTC 2020


On Mon, Oct 19, 2020 at 06:14:14PM -0400, Richard Kimberly Heck wrote:
> On 10/19/20 5:52 PM, Yuriy Skalko wrote:
> > The last pass with the assistance from iwyu tool.
> 
> Assuming it compiles, it looks fine. Using strfwd.h in various places is
> definitely worth it.

I am sorry, but this is causing a load of errors on cygwin. I am going
to fix it by using docstring.h instead of strfwd.h where necessary.

The following one is the kind of compile error I get. I am surprised that
it seems to compile fine with mingw, though.

  CXX      Counters.o
In file included from ../../src/Counters.cpp:16:
../../src/Counters.h:95:12: error: field ‘master_’ has incomplete type ‘lyx::docstring’ {aka ‘std::basic_string<unsigned int, std::char_traits<unsigned int>, std::allocator<unsigned int> >’}
   95 |  docstring master_;
      |            ^~~~~~~
In file included from ../../src/Counters.h:20,
                 from ../../src/Counters.cpp:16:
../../src/support/strfwd.h:55:64: note: declaration of ‘lyx::docstring’ {aka ‘class std::basic_string<unsigned int, std::char_traits<unsigned int>, std::allocator<unsigned int> >’}
   55 | template<typename Char, typename Traits, typename Alloc> class basic_string;
      |                                                                ^~~~~~~~~~~~
In file included from ../../src/Counters.cpp:16:
../../src/Counters.h:97:12: error: field ‘labelstring_’ has incomplete type ‘lyx::docstring’ {aka ‘std::basic_string<unsigned int, std::char_traits<unsigned int>, std::allocator<unsigned int> >’}
   97 |  docstring labelstring_;
      |            ^~~~~~~~~~~~
In file included from ../../src/Counters.h:20,
                 from ../../src/Counters.cpp:16:
../../src/support/strfwd.h:55:64: note: declaration of ‘lyx::docstring’ {aka ‘class std::basic_string<unsigned int, std::char_traits<unsigned int>, std::allocator<unsigned int> >’}
   55 | template<typename Char, typename Traits, typename Alloc> class basic_string;
      |                                                                ^~~~~~~~~~~~
In file included from ../../src/Counters.cpp:16:
../../src/Counters.h:99:12: error: field ‘labelstringappendix_’ has incomplete type ‘lyx::docstring’ {aka ‘std::basic_string<unsigned int, std::char_traits<unsigned int>, std::allocator<unsigned int> >’}
   99 |  docstring labelstringappendix_;
      |            ^~~~~~~~~~~~~~~~~~~~
In file included from ../../src/Counters.h:20,
                 from ../../src/Counters.cpp:16:
../../src/support/strfwd.h:55:64: note: declaration of ‘lyx::docstring’ {aka ‘class std::basic_string<unsigned int, std::char_traits<unsigned int>, std::allocator<unsigned int> >’}
   55 | template<typename Char, typename Traits, typename Alloc> class basic_string;
      |                                                                ^~~~~~~~~~~~
In file included from ../../src/Counters.cpp:16:
../../src/Counters.h:101:12: error: field ‘prettyformat_’ has incomplete type ‘lyx::docstring’ {aka ‘std::basic_string<unsigned int, std::char_traits<unsigned int>, std::allocator<unsigned int> >’}
  101 |  docstring prettyformat_;
      |            ^~~~~~~~~~~~~
In file included from ../../src/Counters.h:20,
                 from ../../src/Counters.cpp:16:
../../src/support/strfwd.h:55:64: note: declaration of ‘lyx::docstring’ {aka ‘class std::basic_string<unsigned int, std::char_traits<unsigned int>, std::allocator<unsigned int> >’}
   55 | template<typename Char, typename Traits, typename Alloc> class basic_string;
      |                                                                ^~~~~~~~~~~~
In file included from ../../src/Counters.cpp:16:
../../src/Counters.h:103:12: error: field ‘guiname_’ has incomplete type ‘lyx::docstring’ {aka ‘std::basic_string<unsigned int, std::char_traits<unsigned int>, std::allocator<unsigned int> >’}
  103 |  docstring guiname_;
      |            ^~~~~~~~
In file included from ../../src/Counters.h:20,
                 from ../../src/Counters.cpp:16:
../../src/support/strfwd.h:55:64: note: declaration of ‘lyx::docstring’ {aka ‘class std::basic_string<unsigned int, std::char_traits<unsigned int>, std::allocator<unsigned int> >’}
   55 | template<typename Char, typename Traits, typename Alloc> class basic_string;
      |                                                                ^~~~~~~~~~~~
In file included from ../../src/Counters.cpp:16:
../../src/Counters.h:252:14: error: field ‘current_float_’ has incomplete type ‘std::string’ {aka ‘std::basic_string<char, std::char_traits<char>, std::allocator<char> >’}
  252 |  std::string current_float_;
      |              ^~~~~~~~~~~~~~
In file included from ../../src/Counters.h:20,
                 from ../../src/Counters.cpp:16:
../../src/support/strfwd.h:55:64: note: declaration of ‘std::string’ {aka ‘class std::basic_string<char, std::char_traits<char>, std::allocator<char> >’}
   55 | template<typename Char, typename Traits, typename Alloc> class basic_string;
      |                                                                ^~~~~~~~~~~~
In file included from ../../src/Counters.cpp:16:
../../src/Counters.h:166:41: error: invalid use of incomplete type ‘lyx::docstring’ {aka ‘class std::basic_string<unsigned int, std::char_traits<unsigned int>, std::allocator<unsigned int> >’}
  166 |     docstring const & match = docstring());
      |                                         ^
In file included from ../../src/Counters.h:20,
                 from ../../src/Counters.cpp:16:
../../src/support/strfwd.h:55:64: note: declaration of ‘lyx::docstring’ {aka ‘class std::basic_string<unsigned int, std::char_traits<unsigned int>, std::allocator<unsigned int> >’}
   55 | template<typename Char, typename Traits, typename Alloc> class basic_string;
      |                                                                ^~~~~~~~~~~~
  CXX      CutAndPaste.o
make[4]: *** [Makefile:2201: Counters.o] Errore 1
make[4]: *** Attesa per i processi non terminati....
make[4]: uscita dalla directory «/usr/local/src/lyx/lyx-devel/build-cygwin/src»
make[3]: *** [Makefile:2391: all-recursive] Errore 1
make[3]: uscita dalla directory «/usr/local/src/lyx/lyx-devel/build-cygwin/src»
make[2]: *** [Makefile:1493: all] Errore 2
make[2]: uscita dalla directory «/usr/local/src/lyx/lyx-devel/build-cygwin/src»
make[1]: *** [Makefile:566: all-recursive] Errore 1
make[1]: uscita dalla directory «/usr/local/src/lyx/lyx-devel/build-cygwin»
make: *** [Makefile:460: all] Errore 2

-- 
Enrico


More information about the lyx-devel mailing list