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 13:23:42 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0

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:

std::map<std::string, std::set<std::string>> m_class_precedence_table;

That would be either 1 (m_class_precedence_table consider one argument) or 2 (expanded m_class_precedence_table). I think the compiler in this case is truncating the template when it sees the word "template" again. That would be "1" and perhaps something strange in the compiler expands the second "template" into 2 arguments, hence creating 1 + 2 = 3 arguments.

Dan



reply via email to

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