octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gcc7 build error with recent tip


From: John W. Eaton
Subject: Re: gcc7 build error with recent tip
Date: Sat, 24 Jun 2017 15:58:47 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

On 06/24/2017 02:23 PM, Daniel J Sebald wrote:
On 06/24/2017 11:21 AM, Dmitri A. Sergatskov wrote:
On Sat, Jun 24, 2017 at 10:59 AM, John W. Eaton <address@hidden
<mailto:address@hidden>> wrote:


    I admit this code is a bit tricky.  I was trying to come up with a
    way to use a single template that would cover both of these cases:

      static octave_value
      dump_container_map (const std::map<std::string,
    std::list<std::string>>&)

      static octave_value
      dump_container_map (const std::map<std::string,
    std::map<std::string>>&)

    It works for me with gcc version 6.3.0 20170516 (Debian 6.3.0-18).


​It is quite possible this is a bug in gcc7.1.1.
I filled a bug:

​https://bugzilla.redhat.com/show_bug.cgi?id=1464612

would like to see what Jakub has to say about it.

Yes, that is quite possible, based upon the error message.  The compiler
identifies the proper candidate, but it is telling us that the candidate
expects only one argument.  I.e.,

../src/libinterp/corefcn/symtab.cc:1424:1: note: candidate:
template<class V, template<class ...> class C> octave_value
dump_container_map(const std::map<std::__cxx11::basic_string<char>, C<V>
&)
 dump_container_map (const std::map<std::string, C<V>>& container_map)
 ^~~~~~~~~~~~~~~~~~
../src/libinterp/corefcn/symtab.cc:1424:1: note:   template argument
deduction/substitution failed:
../src/libinterp/corefcn/symtab.cc:1446:73: note:   candidate expects 1
argument, 3 provided
        {"precedence_table", dump_container_map
(m_class_precedence_table)},

but I don't understand where the compiler is getting those number 3
from.  Here's the definition of m_class_precedence_table:

The template substitution that is failing is for std::set which takes 1, 2, or 3 template parameters. The other, for std::list, takes 1 or 2.

I checked in the following changeset and the problem seems to be fixed for both GCC 6 and 7:

  http://hg.savannah.gnu.org/hgweb/octave/rev/93371ce5378d

Now I'm not sure whether this is a bug in GCC 7 or if it was a bug in previous versions to accept the template without the "A..." argument.

jwe







reply via email to

[Prev in Thread] Current Thread [Next in Thread]