Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSVC build failures: special_value_from_string redefinition #143

Closed
Lastique opened this issue Apr 3, 2020 · 3 comments · Fixed by #144
Closed

MSVC build failures: special_value_from_string redefinition #143

Lastique opened this issue Apr 3, 2020 · 3 comments · Fixed by #144

Comments

@Lastique
Copy link
Member

Lastique commented Apr 3, 2020

Current develop (revision 4a46476) fails to compile with any MSVC version, as can be seen here:

.\boost/date_time/gregorian/parsers.hpp(26) : error C2375: 'boost::gregorian::special_value_from_string' : redefinition; different linkage
        .\boost/date_time/gregorian/greg_month.hpp(142) : see declaration of 'boost::gregorian::special_value_from_string'
@JeffGarland
Copy link
Collaborator

JeffGarland commented Apr 3, 2020

Ok I'll look at it, but if this is the case our system is broken -- the regressions have been running clean for 2 weeks...not to mention that that change ran clean on all the msvc compilers before committed.

@Lastique
Copy link
Member Author

Lastique commented Apr 4, 2020

This problem is also present in master.

It reproduces only when you include both parsers.hpp and greg_month.hpp in one TU. If it doesn't happen in Boost.DateTime, and special_value_from_string does not get called when parsers.hpp is included, then the issue remains undetected.

I would suggest adding a test generator for header self-sufficiency (here is an example and the associated test template) and a test that includes all library headers at once. The latter would have shown this problem, the former would trigger if there are any missing includes. If you trust boost/date_time.hpp to truly include everything then the former will cover the latter.

Lastique added a commit to Lastique/date_time that referenced this issue Apr 4, 2020
This resolves different attributes applied to the function definition
in parsers.hpp and greg_month.hpp. The function is now inline and defined
in parsers.hpp.

Also, the commit converts tabs to spaces and trims trailing spaces.

Fixes boostorg#143.
@JeffGarland
Copy link
Collaborator

Thanks for taking this on before I got to it :) This did need fixing before 1.73 and was clearly induced by my recent changes.

Lastique added a commit to Lastique/date_time that referenced this issue Apr 4, 2020
This resolves different attributes applied to the function definition
in parsers.hpp and greg_month.hpp. The function is now inline and defined
in parsers.hpp.

Also, the commit converts tabs to spaces and trims trailing spaces.

Fixes boostorg#143.
Lastique added a commit to Lastique/date_time that referenced this issue Apr 5, 2020
This resolves different attributes applied to the function definition
in parsers.hpp and greg_month.hpp. The function is now inline and defined
in parsers.hpp.

Also, the commit converts tabs to spaces and trims trailing spaces.

Fixes boostorg#143.
JeffGarland pushed a commit that referenced this issue Apr 5, 2020
* Added a test generator for whether all public headers are self-contained.

The generator creates a compile test for every public header, unless
BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS environment variable
is set to 1.

* Only enable self-contained header tests on a few jobs.

There is no point in performing self-contained header tests on every compiler
configuration, so running them only on some saves CI time.

* Make public headers self-contained.

This commit:

- Adds missing includes.
- Adjusts gregorian namespace qualification in a few places to use use
  equivalent symbols from date_time and not have to include gregorian
  headers.
- Converts tabs to spaces and trims trailing spaces.

This makes the self-contained header tests pass on Linux.

* Move special_value_from_string definition to parsers.hpp.

This resolves different attributes applied to the function definition
in parsers.hpp and greg_month.hpp. The function is now inline and defined
in parsers.hpp.

Also, the commit converts tabs to spaces and trims trailing spaces.

Fixes #143.

* Convert tabs to spaces and trim trailing spaces.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants