Bug 81204 - [7/8 Regression] Rejects boost headers
Summary: [7/8 Regression] Rejects boost headers
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 7.1.1
: P3 normal
Target Milestone: 7.2
Assignee: Jason Merrill
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2017-06-26 08:57 UTC by Richard Biener
Modified: 2021-08-04 06:27 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work: 6.3.1
Known to fail: 7.1.1, 8.0
Last reconfirmed: 2017-06-26 00:00:00


Attachments
unreduced unincluded testcase (500.86 KB, application/octet-stream)
2017-06-26 08:57 UTC, Richard Biener
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Biener 2017-06-26 08:57:05 UTC
Created attachment 41629 [details]
unreduced unincluded testcase

Works with G++6, fails with G++7 with

In file included from /usr/include/boost/geometry/geometries/helper_geometry.hpp:21:0,
                 from /usr/include/boost/geometry/algorithms/detail/disjoint/point_point.hpp:41,
                 from /usr/include/boost/geometry/algorithms/detail/equals/point_point.hpp:24,
                 from /usr/include/boost/geometry/strategies/cartesian/intersection.hpp:29,
                 from /usr/include/boost/geometry/strategies/intersection_strategies.hpp:28,
                 from /usr/include/boost/geometry/strategies/strategies.hpp:37,
                 from /usr/include/boost/geometry/geometry.hpp:50,
                 from /usr/include/boost/geometry.hpp:17,
                 from test.cpp:9:
/usr/include/boost/geometry/geometries/point.hpp: In static member function ‘static void boost::geometry::traits::access<boost::geometry::model::point<CoordinateType, DimensionCount, CoordinateSystem>, Dimension>::set(boost::geometry::model::point<CoordinateType, DimensionCount, CoordinateSystem>&, const CoordinateType&)’:
/usr/include/boost/geometry/geometries/point.hpp:290:33: error: type/value mismatch at argument 1 in template parameter list for ‘template<class _Key, class _Compare, class _Alloc> class std::set’
/usr/include/boost/geometry/geometries/point.hpp:290:33: note:   expected a type, got ‘Dimension’
/usr/include/boost/geometry/geometries/point.hpp:290:33: error: template argument 2 is invalid
/usr/include/boost/geometry/geometries/point.hpp:290:33: error: template argument 3 is invalid
In file included from /usr/include/boost/geometry/algorithms/detail/normalize.hpp:27:0,
                 from /usr/include/boost/geometry/algorithms/detail/disjoint/point_point.hpp:45,
                 from /usr/include/boost/geometry/algorithms/detail/equals/point_point.hpp:24,
                 from /usr/include/boost/geometry/strategies/cartesian/intersection.hpp:29,
                 from /usr/include/boost/geometry/strategies/intersection_strategies.hpp:28,
                 from /usr/include/boost/geometry/strategies/strategies.hpp:37,
                 from /usr/include/boost/geometry/geometry.hpp:50,
                 from /usr/include/boost/geometry.hpp:17,
                 from test.cpp:9:
/usr/include/boost/geometry/views/detail/indexed_point_view.hpp: In static member function ‘static void boost::geometry::traits::access<boost::geometry::detail::indexed_point_view<Geometry, Index>, Dimension>::set(boost::geometry::detail::indexed_point_view<Geometry, Index>&, const coordinate_type&)’:
/usr/include/boost/geometry/views/detail/indexed_point_view.hpp:113:33: error: type/value mismatch at argument 1 in template parameter list for ‘template<class _Key, class _Compare, class _Alloc> class std::set’
...
Comment 1 Richard Biener 2017-06-26 08:58:26 UTC
Original boost testcase:

#include <iostream>

#include <set>

using namespace std;

#include <boost/geometry.hpp>
#include <boost/numeric/ublas/blas.hpp>

int main()
{
    cout << "Hello World!" << endl;
    return 0;
}


clang++4 is said to accept the code as well.
Comment 2 Jonathan Wakely 2017-06-26 10:23:05 UTC
Started with r236221
Comment 3 Jonathan Wakely 2017-06-26 12:25:34 UTC
Reduced:

namespace std {
  template<typename, typename> struct set { };
}

using namespace std;

template <int I, typename Result>
inline void set(Result & res)
{
    res.template set<I>();
}
Comment 4 Jonathan Wakely 2017-06-27 22:36:12 UTC
dup of PR 81026?
Comment 5 Jason Merrill 2017-06-28 19:41:53 UTC
Author: jason
Date: Wed Jun 28 19:41:18 2017
New Revision: 249750

URL: https://gcc.gnu.org/viewcvs?rev=249750&root=gcc&view=rev
Log:
	PR c++/81204 - parse error with dependent template-name

	* parser.c (cp_parser_lookup_name): Disqualify function templates
	after lookup.

Added:
    trunk/gcc/testsuite/g++.dg/template/lookup10.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/parser.c
Comment 6 Jason Merrill 2017-06-28 21:09:15 UTC
Author: jason
Date: Wed Jun 28 21:08:43 2017
New Revision: 249761

URL: https://gcc.gnu.org/viewcvs?rev=249761&root=gcc&view=rev
Log:
	PR c++/81204 - parse error with dependent template-name

	* parser.c (cp_parser_lookup_name): Disqualify function templates
	after lookup.

Added:
    branches/gcc-7-branch/gcc/testsuite/g++.dg/template/lookup10.C
Modified:
    branches/gcc-7-branch/gcc/cp/ChangeLog
    branches/gcc-7-branch/gcc/cp/parser.c
Comment 7 Jason Merrill 2017-06-28 21:11:31 UTC
Fixed for 7.2.
Comment 8 Jason Merrill 2017-07-06 18:27:31 UTC
Author: jason
Date: Thu Jul  6 18:26:59 2017
New Revision: 250037

URL: https://gcc.gnu.org/viewcvs?rev=250037&root=gcc&view=rev
Log:
	PR c++/81204 - parse error with dependent template-name
	* parser.c (cp_parser_lookup_name): Revert previous change.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/variadic-mem_fn2.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/parser.c
Comment 9 Jason Merrill 2017-07-06 18:27:37 UTC
Author: jason
Date: Thu Jul  6 18:27:05 2017
New Revision: 250038

URL: https://gcc.gnu.org/viewcvs?rev=250038&root=gcc&view=rev
Log:
	PR c++/81204 - parse error with dependent template-name
	* parser.c (cp_parser_lookup_name): Revert previous change.

Added:
    branches/gcc-7-branch/gcc/testsuite/g++.dg/cpp0x/variadic-mem_fn2.C
Modified:
    branches/gcc-7-branch/gcc/cp/ChangeLog
    branches/gcc-7-branch/gcc/cp/parser.c
Comment 10 Jason Merrill 2017-07-06 18:42:36 UTC
(still fixed, by the patch for bug 54769)