#13498: 4ti2 fails to build with GCC >= 4.7
-------------------------------------------+--------------------------------
Reporter: novoselt | Owner: tbd
Type: defect | Status: new
Priority: major | Milestone: sage-5.9
Component: packages: optional | Resolution:
Keywords: -fpermissive C++11 spkg | Work issues:
Report Upstream: N/A | Reviewers:
Authors: | Merged in:
Dependencies: | Stopgaps:
-------------------------------------------+--------------------------------
Description changed by leif:
Old description:
> Log attached.
New description:
Log attached.
----
From the [http://gcc.gnu.org/gcc-4.7/changes.html GCC 4.7 release notes]
(C++ section):
G++ now correctly implements the two-phase lookup rules such that an
unqualified name used in a template must have an appropriate declaration
found either in scope at the point of definition of the template or by
argument-dependent lookup at the point of instantiation. As a result, code
that relies on a second unqualified lookup at the point of instantiation
to find functions declared after the template or in dependent bases will
be rejected. The compiler will suggest ways to fix affected code, and
using the `-fpermissive` compiler flag will allow the code to compile with
a warning.
{{{
#!c++
template <class T>
void f() { g(T()); } // error, g(int) not found by argument-dependent
lookup
void g(int) { } // fix by moving this declaration before the declaration
of f
template <class T>
struct A: T {
// error, B::g(B) not found by argument-dependent lookup
void f() { g(T()); } // fix by using this->g or A::g
};
struct B { void g(B); };
int main()
{
f<int>();
A<B>().f();
}
}}}
--
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13498#comment:3>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.