public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/66832] New: [concepts] parameters in requires clauses conflicting with function arguments
@ 2015-07-10 17:42 eric.niebler at gmail dot com
  2015-07-10 22:46 ` [Bug c++/66832] " jason at gcc dot gnu.org
  2015-07-10 22:52 ` jason at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: eric.niebler at gmail dot com @ 2015-07-10 17:42 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 66832
           Summary: [concepts] parameters in requires clauses conflicting
                    with function arguments
           Product: gcc
           Version: c++-concepts
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: eric.niebler at gmail dot com
  Target Milestone: ---

template <class T, class U, unsigned N>
  requires requires (T& t, U &u) { t.foo(); u.foo(); }
void foo_all( T (&t)[N], U (&u)[N] ) {
  for(auto& x : t)
      x.foo();
  for(auto& x : u)
      x.foo();
}

struct S {
  void foo() {}
};

int main() {
  S rg[4] {};
  foo_all(rg, rg);
}


Yields:

/cygdrive/c/Users/eric/Code/cmcstl2/test/iterator.cpp:4:23: error: conflicting
declaration ‘T (& t)[N]’
 void foo_all( T (&t)[N], U (&u)[N] ) {
                       ^
/cygdrive/c/Users/eric/Code/cmcstl2/test/iterator.cpp:3:25: note: previous
declaration as ‘T& t’
   requires requires (T& t, U &u) { t.foo(); u.foo(); }
                         ^
/cygdrive/c/Users/eric/Code/cmcstl2/test/iterator.cpp: In function ‘void
foo_all(U (&)[N])’:
/cygdrive/c/Users/eric/Code/cmcstl2/test/iterator.cpp:5:18: error: use of
parameter outside function body before ‘)’ token
   for(auto& x : t)
                  ^
/cygdrive/c/Users/eric/Code/cmcstl2/test/iterator.cpp: In function ‘int
main()’:
/cygdrive/c/Users/eric/Code/cmcstl2/test/iterator.cpp:17:17: error: no matching
function for call to ‘foo_all(S [4], S [4])’
   foo_all(rg, rg);
                 ^
/cygdrive/c/Users/eric/Code/cmcstl2/test/iterator.cpp:4:6: note: candidate:
template<class T, class U, unsigned int N>  requires predicate(r
equires(T& t, U& u) {t->foo();u->foo();}) void foo_all(U (&)[N])
 void foo_all( T (&t)[N], U (&u)[N] ) {
      ^
/cygdrive/c/Users/eric/Code/cmcstl2/test/iterator.cpp:4:6: note:   template
argument deduction/substitution failed:
/cygdrive/c/Users/eric/Code/cmcstl2/test/iterator.cpp:17:17: note:   candidate
expects 1 argument, 2 provided
   foo_all(rg, rg);
                 ^
>From gcc-bugs-return-492006-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Jul 10 17:47:18 2015
Return-Path: <gcc-bugs-return-492006-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 123628 invoked by alias); 10 Jul 2015 17:47:17 -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 123575 invoked by uid 48); 10 Jul 2015 17:47:14 -0000
From: "damian at sourceryinstitute dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/66833] New: [4.9/5.1/6.0]: ICE on assumed-rank character actual argument to intrinsic functions
Date: Fri, 10 Jul 2015 17:47:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Version: 4.9.3
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: damian at sourceryinstitute dot org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone
Message-ID: <bug-66833-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: 2015-07/txt/msg00896.txt.bz2
Content-length: 1304

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

            Bug ID: 66833
           Summary: [4.9/5.1/6.0]: ICE on assumed-rank character actual
                    argument to intrinsic functions
           Product: gcc
           Version: 4.9.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: damian at sourceryinstitute dot org
  Target Milestone: ---

Invoking a rank, lbound, ubound, or c_loc with an assumed-rank character array
actual argument causes an ICE with gfortran 4.9.3, 5.1.0, or 6.0.0.  I wonder
if this is related to Bug 5733.

$ cat opencoarrays.f90
subroutine gfc_descriptor_c_char(a)
  character a(..)
  print *,rank(a) ! ICE (also for lbound, ubound, and c_loc)
end subroutine

$ gfortran -c opencoarrays.f90
opencoarrays.f90: In function 'gfc_descriptor_c_char':
opencoarrays.f90:3:0: internal compiler error: in gfc_conv_descriptor_dtype, at
fortran/trans-array.c:239
   print *,rank(a) ! ICE (also for lbound, ubound, and c_loc)
 ^

opencoarrays.f90:3:0: internal compiler error: Abort trap: 6
gfortran: internal compiler error: Abort trap: 6 (program f951)
Abort trap: 6

$ gfortran --version
GNU Fortran (MacPorts gcc49 4.9.3_0) 4.9.3


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

* [Bug c++/66832] [concepts] parameters in requires clauses conflicting with function arguments
  2015-07-10 17:42 [Bug c++/66832] New: [concepts] parameters in requires clauses conflicting with function arguments eric.niebler at gmail dot com
@ 2015-07-10 22:46 ` jason at gcc dot gnu.org
  2015-07-10 22:52 ` jason at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: jason at gcc dot gnu.org @ 2015-07-10 22:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Fri Jul 10 22:45:41 2015
New Revision: 225704

URL: https://gcc.gnu.org/viewcvs?rev=225704&root=gcc&view=rev
Log:
        PR c++/66758
        PR c++/66832
        * gcc/cp/parser.c (cp_parser_requires_expression): Call grokparms here.
        (cp_parser_requirement_parameter_list): Not here.

Added:
    branches/c++-concepts/gcc/testsuite/g++.dg/concepts/req15.C
Modified:
    branches/c++-concepts/ChangeLog.concepts
    branches/c++-concepts/gcc/cp/parser.c


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

* [Bug c++/66832] [concepts] parameters in requires clauses conflicting with function arguments
  2015-07-10 17:42 [Bug c++/66832] New: [concepts] parameters in requires clauses conflicting with function arguments eric.niebler at gmail dot com
  2015-07-10 22:46 ` [Bug c++/66832] " jason at gcc dot gnu.org
@ 2015-07-10 22:52 ` jason at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: jason at gcc dot gnu.org @ 2015-07-10 22:52 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED

--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed.


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

end of thread, other threads:[~2015-07-10 22:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-10 17:42 [Bug c++/66832] New: [concepts] parameters in requires clauses conflicting with function arguments eric.niebler at gmail dot com
2015-07-10 22:46 ` [Bug c++/66832] " jason at gcc dot gnu.org
2015-07-10 22:52 ` jason 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).