public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/62256] New: /usr/include/c++/4.8/tr1/random.tcc:792:2: error: no matching function for call to 'min'
@ 2014-08-25 15:12 wangn at ca dot ibm.com
  2014-08-25 21:53 ` [Bug c++/62256] " redi at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: wangn at ca dot ibm.com @ 2014-08-25 15:12 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62256

            Bug ID: 62256
           Summary: /usr/include/c++/4.8/tr1/random.tcc:792:2: error: no
                    matching function for call to 'min'
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: wangn at ca dot ibm.com

use g++ to compile perennial test case TR19768/P95252.scenario fails. seems
related to header file.

source code:
$ cat t.cpp
#include <tr1/random>

typedef std::tr1::xor_combine< std::tr1::subtract_with_carry<short, 24, 10,
16>, 8, std::tr1::subtract_with_carry<short, 48, 10, 24>, 2 > type01;

/*--------------------------------------------------------------------*/
int main(void)
{
    type01 cl01;
    return 0;
}


how to reproduce:

g++ -c t.cpp

actual output:

In file included from /usr/include/c++/4.8/tr1/random:48:0,
                 from t.cpp:1:
/usr/include/c++/4.8/tr1/random.tcc: In instantiation of âvoid
std::tr1::xor_combine<_UniformRandomNumberGenerator1, __s1,
_UniformRandomNumberGenerator2, __s2>::_M_initialize_max() [with
_UniformRandomNumberGenerator1 = std::tr1::subtract_with_carry<short int, 24,
10, 16>; int __s1 = 8; _UniformRandomNumberGenerator2 =
std::tr1::subtract_with_carry<short int, 48, 10, 24>; int __s2 = 2]â:
/usr/include/c++/4.8/tr1/random.h:1324:27:   required from
âstd::tr1::xor_combine<_UniformRandomNumberGenerator1, __s1,
_UniformRandomNumberGenerator2, __s2>::xor_combine() [with
_UniformRandomNumberGenerator1 = std::tr1::subtract_with_carry<short int, 24,
10, 16>; int __s1 = 8; _UniformRandomNumberGenerator2 =
std::tr1::subtract_with_carry<short int, 48, 10, 24>; int __s2 = 2]â
t.cpp:8:12:   required from here
/usr/include/c++/4.8/tr1/random.tcc:793:58: error: no matching function for
call to âmin(std::tr1::xor_combine<std::tr1::subtract_with_carry<short int, 24,
10, 16>, 8, std::tr1::subtract_with_carry<short int, 48, 10, 24>,
2>::result_type, int)â
    __detail::_Shift<result_type, __w - __s1>::__value - 1);
                                                          ^
/usr/include/c++/4.8/tr1/random.tcc:793:58: note: candidates are:
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
                 from /usr/include/c++/4.8/string:40,
                 from /usr/include/c++/4.8/tr1/random:38,
                 from t.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:193:5: note: template<class _Tp> const
_Tp& std::min(const _Tp&, const _Tp&)
     min(const _Tp& __a, const _Tp& __b)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:193:5: note:   template argument
deduction/substitution failed:
In file included from /usr/include/c++/4.8/tr1/random:48:0,
                 from t.cpp:1:
/usr/include/c++/4.8/tr1/random.tcc:793:58: note:   deduced conflicting types
for parameter âconst _Tpâ (âshort intâ and âintâ)
    __detail::_Shift<result_type, __w - __s1>::__value - 1);
                                                          ^
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
                 from /usr/include/c++/4.8/string:40,
                 from /usr/include/c++/4.8/tr1/random:38,
                 from t.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:239:5: note: template<class _Tp, class
_Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)
     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:239:5: note:   template argument
deduction/substitution failed:
In file included from /usr/include/c++/4.8/tr1/random:48:0,
                 from t.cpp:1:
/usr/include/c++/4.8/tr1/random.tcc:793:58: note:   deduced conflicting types
for parameter âconst _Tpâ (âshort intâ and âintâ)
    __detail::_Shift<result_type, __w - __s1>::__value - 1);
                                                          ^
/usr/include/c++/4.8/tr1/random.tcc:797:58: error: no matching function for
call to âmin(std::tr1::xor_combine<std::tr1::subtract_with_carry<short int, 24,
10, 16>, 8, std::tr1::subtract_with_carry<short int, 48, 10, 24>,
2>::result_type, int)â
    __detail::_Shift<result_type, __w - __s2>::__value - 1);
                                                          ^
/usr/include/c++/4.8/tr1/random.tcc:797:58: note: candidates are:
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
                 from /usr/include/c++/4.8/string:40,
                 from /usr/include/c++/4.8/tr1/random:38,
                 from t.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:193:5: note: template<class _Tp> const
_Tp& std::min(const _Tp&, const _Tp&)
     min(const _Tp& __a, const _Tp& __b)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:193:5: note:   template argument
deduction/substitution failed:
In file included from /usr/include/c++/4.8/tr1/random:48:0,
                 from t.cpp:1:
/usr/include/c++/4.8/tr1/random.tcc:797:58: note:   deduced conflicting types
for parameter âconst _Tpâ (âshort intâ and âintâ)
    __detail::_Shift<result_type, __w - __s2>::__value - 1);
                                                          ^
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
                 from /usr/include/c++/4.8/string:40,
                 from /usr/include/c++/4.8/tr1/random:38,
                 from t.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:239:5: note: template<class _Tp, class
_Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)
     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:239:5: note:   template argument
deduction/substitution failed:
In file included from /usr/include/c++/4.8/tr1/random:48:0,
                 from t.cpp:1:
/usr/include/c++/4.8/tr1/random.tcc:797:58: note:   deduced conflicting types
for parameter âconst _Tpâ (âshort intâ and âintâ)
    __detail::_Shift<result_type, __w - __s2>::__value - 1);
                                                          ^
expected output:

compile clean
>From gcc-bugs-return-459201-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Aug 25 15:47:06 2014
Return-Path: <gcc-bugs-return-459201-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 2635 invoked by alias); 25 Aug 2014 15:47:06 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 2581 invoked by uid 48); 25 Aug 2014 15:46:59 -0000
From: "jrtc27 at jrtc27 dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/61407] Build errors on latest OS X 10.10 Yosemite with Xcode 6 on GCC 4.8.3
Date: Mon, 25 Aug 2014 15:47:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: unknown
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: jrtc27 at jrtc27 dot com
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-61407-4-mOAnzjZFm0@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-61407-4@http.gcc.gnu.org/bugzilla/>
References: <bug-61407-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-08/txt/msg01698.txt.bz2
Content-length: 714

https://gcc.gnu.org/bugzilla/show_bug.cgi?ida407

--- Comment #25 from James Clarke <jrtc27 at jrtc27 dot com> ---
(In reply to Dominyk Tiller from comment #24)
> It looks like gcc are gonna require someone to submit this patch to their
> mailing list before we see any further activity on this. Could you possibly
> do that? Would massively appreciate it. More details are here:
> https://gcc.gnu.org/contribute.html

Working on it now. Need to clean it up, separate the diffs, add relevant test
cases and check it all still compiles and passes the tests before submitting
though. And of course doing a full bootstrap (a required test) takes quite a
while. Will post an update when I've submitted the patches.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/62256] /usr/include/c++/4.8/tr1/random.tcc:792:2: error: no matching function for call to 'min'
  2014-08-25 15:12 [Bug c++/62256] New: /usr/include/c++/4.8/tr1/random.tcc:792:2: error: no matching function for call to 'min' wangn at ca dot ibm.com
@ 2014-08-25 21:53 ` redi at gcc dot gnu.org
  2014-08-26 11:07 ` [Bug libstdc++/62256] " redi at gcc dot gnu.org
  2014-08-26 11:19 ` rguenth at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2014-08-25 21:53 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62256

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|major                       |normal


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libstdc++/62256] /usr/include/c++/4.8/tr1/random.tcc:792:2: error: no matching function for call to 'min'
  2014-08-25 15:12 [Bug c++/62256] New: /usr/include/c++/4.8/tr1/random.tcc:792:2: error: no matching function for call to 'min' wangn at ca dot ibm.com
  2014-08-25 21:53 ` [Bug c++/62256] " redi at gcc dot gnu.org
@ 2014-08-26 11:07 ` redi at gcc dot gnu.org
  2014-08-26 11:19 ` rguenth at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2014-08-26 11:07 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62256

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-08-26
     Ever confirmed|0                           |1

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
This would fix it, but I'm not planning to commit it because I don't think
anyone cares about TR1 in current versions of GCC:

--- a/libstdc++-v3/include/tr1/random.tcc
+++ b/libstdc++-v3/include/tr1/random.tcc
@@ -789,11 +789,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       const int __w = std::numeric_limits<result_type>::digits;

       const result_type __m1 =
-       std::min(result_type(_M_b1.max() - _M_b1.min()),
+       std::min<result_type>(result_type(_M_b1.max() - _M_b1.min()),
                 __detail::_Shift<result_type, __w - __s1>::__value - 1);

       const result_type __m2 =
-       std::min(result_type(_M_b2.max() - _M_b2.min()),
+       std::min<result_type>(result_type(_M_b2.max() - _M_b2.min()),
                 __detail::_Shift<result_type, __w - __s2>::__value - 1);

       // NB: In TR1 s1 is not required to be >= s2.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libstdc++/62256] /usr/include/c++/4.8/tr1/random.tcc:792:2: error: no matching function for call to 'min'
  2014-08-25 15:12 [Bug c++/62256] New: /usr/include/c++/4.8/tr1/random.tcc:792:2: error: no matching function for call to 'min' wangn at ca dot ibm.com
  2014-08-25 21:53 ` [Bug c++/62256] " redi at gcc dot gnu.org
  2014-08-26 11:07 ` [Bug libstdc++/62256] " redi at gcc dot gnu.org
@ 2014-08-26 11:19 ` rguenth at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-08-26 11:19 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62256

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |WONTFIX

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Thus wontfix.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-08-26 11:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-25 15:12 [Bug c++/62256] New: /usr/include/c++/4.8/tr1/random.tcc:792:2: error: no matching function for call to 'min' wangn at ca dot ibm.com
2014-08-25 21:53 ` [Bug c++/62256] " redi at gcc dot gnu.org
2014-08-26 11:07 ` [Bug libstdc++/62256] " redi at gcc dot gnu.org
2014-08-26 11:19 ` rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).