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: Daniel J Sebald
Subject: Re: gcc7 build error with recent tip
Date: Sat, 24 Jun 2017 16:09:18 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0

On 06/24/2017 02:58 PM, John W. Eaton wrote:
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.

Oh. Looking at the second error in Dmitri's original email, I see now that one says "2 provided" as opposed to "3 provided" from the first error. The error message points directly at dump_container_map() which made me think that was the source of error when in fact it is the expansion inside the template.

Well, that works then.


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.

Or maybe that is a difference between C++11 and its predecessors, i.e., more explicit definition of templates rather than leaving it to interpretation. (I see ::__cxx11:: in some variable names in the error messages so I assume the compiler is doing C++11.)

Dan



reply via email to

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