public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/65186] New: internal compiler error: in tsubst, at cp/pt.c:11738
@ 2015-02-24  8:07 shum at canndrew dot org
  2015-02-24  9:11 ` [Bug c++/65186] " jakub at gcc dot gnu.org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: shum at canndrew dot org @ 2015-02-24  8:07 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 65186
           Summary: internal compiler error: in tsubst, at cp/pt.c:11738
           Product: gcc
           Version: 4.9.2
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: shum at canndrew dot org

The following code causes an ICE in gcc-4.9.2



template<typename A, A x, A y>
using Id = int;

template<
  typename A,
  A x,
  A y,
  Id<A, x, y> p,
  template<A a, A b, Id<A, a, b>> class C,
  C<x, x, x>>
using J = C<x, y, p>;

int main() {
  return 0;
}


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

* [Bug c++/65186] internal compiler error: in tsubst, at cp/pt.c:11738
  2015-02-24  8:07 [Bug c++/65186] New: internal compiler error: in tsubst, at cp/pt.c:11738 shum at canndrew dot org
@ 2015-02-24  9:11 ` jakub at gcc dot gnu.org
  2015-02-24 12:18 ` rguenth at gcc dot gnu.org
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-02-24  9:11 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dodji at gcc dot gnu.org,
                   |                            |jakub at gcc dot gnu.org,
                   |                            |jason at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
ICEs all the way back from r181118 that added support for template aliases.


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

* [Bug c++/65186] internal compiler error: in tsubst, at cp/pt.c:11738
  2015-02-24  8:07 [Bug c++/65186] New: internal compiler error: in tsubst, at cp/pt.c:11738 shum at canndrew dot org
  2015-02-24  9:11 ` [Bug c++/65186] " jakub at gcc dot gnu.org
@ 2015-02-24 12:18 ` rguenth at gcc dot gnu.org
  2015-04-17 10:38 ` redi at gcc dot gnu.org
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-02-24 12:18 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-02-24
     Ever confirmed|0                           |1

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


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

* [Bug c++/65186] internal compiler error: in tsubst, at cp/pt.c:11738
  2015-02-24  8:07 [Bug c++/65186] New: internal compiler error: in tsubst, at cp/pt.c:11738 shum at canndrew dot org
  2015-02-24  9:11 ` [Bug c++/65186] " jakub at gcc dot gnu.org
  2015-02-24 12:18 ` rguenth at gcc dot gnu.org
@ 2015-04-17 10:38 ` redi at gcc dot gnu.org
  2015-04-17 10:40 ` redi at gcc dot gnu.org
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: redi at gcc dot gnu.org @ 2015-04-17 10:38 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |4.8.3, 4.9.2, 5.0, 6.0
           Severity|minor                       |normal

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
This seems to hit the same ICE, without template aliases:

template <typename C, C> struct integral_constant {};

template <typename T, template <typename U, U> class> struct Sort;  

template <template <typename U, U> class Comparator>  
struct Sort<int, Comparator>
{  
    template <int I> struct less_than:
        integral_constant<bool, Comparator<int, I>::value> {};
};

int main() {}


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

* [Bug c++/65186] internal compiler error: in tsubst, at cp/pt.c:11738
  2015-02-24  8:07 [Bug c++/65186] New: internal compiler error: in tsubst, at cp/pt.c:11738 shum at canndrew dot org
                   ` (2 preceding siblings ...)
  2015-04-17 10:38 ` redi at gcc dot gnu.org
@ 2015-04-17 10:40 ` redi at gcc dot gnu.org
  2015-07-08 10:33 ` paolo.carlini at oracle dot com
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: redi at gcc dot gnu.org @ 2015-04-17 10:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
In fact comment 3 doesn't even need C++11, it's valid C++03.

It came from http://stackoverflow.com/a/29696258/981959


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

* [Bug c++/65186] internal compiler error: in tsubst, at cp/pt.c:11738
  2015-02-24  8:07 [Bug c++/65186] New: internal compiler error: in tsubst, at cp/pt.c:11738 shum at canndrew dot org
                   ` (3 preceding siblings ...)
  2015-04-17 10:40 ` redi at gcc dot gnu.org
@ 2015-07-08 10:33 ` paolo.carlini at oracle dot com
  2015-07-08 13:19 ` ppalka at gcc dot gnu.org
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: paolo.carlini at oracle dot com @ 2015-07-08 10:33 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ppalka at gcc dot gnu.org

--- Comment #5 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Dup of c++/30044?


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

* [Bug c++/65186] internal compiler error: in tsubst, at cp/pt.c:11738
  2015-02-24  8:07 [Bug c++/65186] New: internal compiler error: in tsubst, at cp/pt.c:11738 shum at canndrew dot org
                   ` (4 preceding siblings ...)
  2015-07-08 10:33 ` paolo.carlini at oracle dot com
@ 2015-07-08 13:19 ` ppalka at gcc dot gnu.org
  2015-07-11 13:50 ` ppalka at gcc dot gnu.org
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: ppalka at gcc dot gnu.org @ 2015-07-08 13:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Patrick Palka <ppalka at gcc dot gnu.org> ---
(In reply to Paolo Carlini from comment #5)
> Dup of c++/30044?

I don't think it's a duplicate but they do seem related.  My patch for
c++/30044 does not fix this ICE.


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

* [Bug c++/65186] internal compiler error: in tsubst, at cp/pt.c:11738
  2015-02-24  8:07 [Bug c++/65186] New: internal compiler error: in tsubst, at cp/pt.c:11738 shum at canndrew dot org
                   ` (5 preceding siblings ...)
  2015-07-08 13:19 ` ppalka at gcc dot gnu.org
@ 2015-07-11 13:50 ` ppalka at gcc dot gnu.org
  2015-07-11 17:47 ` paolo.carlini at oracle dot com
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: ppalka at gcc dot gnu.org @ 2015-07-11 13:50 UTC (permalink / raw)
  To: gcc-bugs

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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |ppalka at gcc dot gnu.org

--- Comment #8 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Here's a slightly simpler test case:

template <typename T, template <typename U, U> class> struct Sort;

template <template <typename U, U> class Comparator>
struct Sort<int, Comparator>
{
  template <int I>
  struct less_than
  {
    Comparator<int, I> a;
  };
};

I'll try to fix this.


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

* [Bug c++/65186] internal compiler error: in tsubst, at cp/pt.c:11738
  2015-02-24  8:07 [Bug c++/65186] New: internal compiler error: in tsubst, at cp/pt.c:11738 shum at canndrew dot org
                   ` (6 preceding siblings ...)
  2015-07-11 13:50 ` ppalka at gcc dot gnu.org
@ 2015-07-11 17:47 ` paolo.carlini at oracle dot com
  2015-07-11 22:10 ` ppalka at gcc dot gnu.org
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: paolo.carlini at oracle dot com @ 2015-07-11 17:47 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Thanks Patrick!


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

* [Bug c++/65186] internal compiler error: in tsubst, at cp/pt.c:11738
  2015-02-24  8:07 [Bug c++/65186] New: internal compiler error: in tsubst, at cp/pt.c:11738 shum at canndrew dot org
                   ` (7 preceding siblings ...)
  2015-07-11 17:47 ` paolo.carlini at oracle dot com
@ 2015-07-11 22:10 ` ppalka at gcc dot gnu.org
  2015-07-12  8:47 ` paolo.carlini at oracle dot com
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: ppalka at gcc dot gnu.org @ 2015-07-11 22:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Patrick Palka <ppalka at gcc dot gnu.org> ---
When I said that this PR is not a dup of c++/30044 I sadly failed to look at
#c1 and instead only looked at #c3.  The test case in #c1 does appear to
effectively be a dup of c++/30044, and with the fix for that PR now in trunk
this test case no longer ICEs, but now it fails with a compile error:

65186.cc:10:3: error: ‘C<x, x, x>’ is not a valid type for a template non-type
parameter
   C<x, x, x>>
   ^

This seems to be a bogus error because after instantiation C<x, x, x> will
resolve to int which is a valid type for the template parameter.  The fix for
this is simple.

The test cases in #c3 and in #c8 however exposes an entirely different bug than
the test case in #c1 (even though the ICE is the same).  I wonder what the
standard procedure here is.  Should this PR be split into two?
>From gcc-bugs-return-492056-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Jul 11 22:59:29 2015
Return-Path: <gcc-bugs-return-492056-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 129951 invoked by alias); 11 Jul 2015 22:59:28 -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 129933 invoked by uid 48); 11 Jul 2015 22:59:25 -0000
From: "bin.x.fan at oracle dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/66842] New: libatomic uses multiple locks for locked atomics
Date: Sat, 11 Jul 2015 22:59:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libstdc++
X-Bugzilla-Version: 4.9.2
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: bin.x.fan at oracle dot com
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-66842-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-07/txt/msg00946.txt.bz2
Content-length: 2644

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

            Bug ID: 66842
           Summary: libatomic uses multiple locks for locked atomics
           Product: gcc
           Version: 4.9.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bin.x.fan at oracle dot com
  Target Milestone: ---

Hi GCC folks,

I'm opening this bug to report an issue that may or may not be a real bug. I
notice that GCC libatomic uses multiple locks for a locked atomic object whose
size is greater than 64 bytes. The granularity seems to be 64 because for every
64 bytes added to the size, one more lock is added.

It seems that this is to protect overlapping locked atomic object. If locked
atomic objects never overlap, then a more efficient way to do locked atomic
operations would be each object being protected by just one lock that is hashed
from its address.

Accessing a member of an atomic struct object is undefined behavior in C11
standard. So, does GCC support it as an extension or using multiple locks is
unnecessary therefore it’s a performance bug?

Here is my code to illustrate the issue. I interpose pthread_mutex_lock to
count how many times it is called. My GCC version is 4.9.2, and its target is
x86_64-unknown-linux-gnu. The libatomic.so I use comes with the GCC 4.9.2
installation.

-bash-4.2$ cat libmythread.c
#define _GNU_SOURCE
#include <pthread.h>
#include <dlfcn.h>
#include <stdio.h>
#include <assert.h>

static int counter = 0;

int pthread_mutex_lock (pthread_mutex_t *mutex)
{
    static int (*real_pthread_mutex_lock)(pthread_mutex_t *) = NULL;
    if (real_pthread_mutex_lock == NULL) {
        real_pthread_mutex_lock = dlsym (RTLD_NEXT, "pthread_mutex_lock");
    }
    assert (real_pthread_mutex_lock);
    counter++;
    return real_pthread_mutex_lock (mutex);
}

void display_nlocks ()
{
    printf ("pthread_mutex_lock is called %d times\n", counter);
    return;
}
-bash-4.2$ cat c11_locked_atomics.c
#include <stdatomic.h>

#ifndef SIZE
#define SIZE 1024
#endif

typedef struct {
    char a[SIZE];
} lock_obj_t;

extern void display_nlocks ();

int main()
{
    lock_obj_t v2 = {0};
    _Atomic lock_obj_t v1 = ATOMIC_VAR_INIT(v2);
    v2 = atomic_load (&v1);
    display_nlocks ();
    return 0;
}

-bash-4.2$ gcc -shared -ldl -fPIC libmythread.c -o libmythread.so
-bash-4.2$ gcc -latomic c11_locked_atomics.c -DSIZE=2048 -L./ -Wl,-rpath=./
-lmythread
-bash-4.2$ LD_PRELOAD=./libmythread.so a.out
pthread_mutex_lock is called 32 times
>From gcc-bugs-return-492057-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Jul 12 02:29:58 2015
Return-Path: <gcc-bugs-return-492057-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 119856 invoked by alias); 12 Jul 2015 02:29:54 -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 117760 invoked by uid 48); 12 Jul 2015 02:29:45 -0000
From: "fvvnaqnd at grr dot la" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/66843] New: g++ outputting nonsense errors, won't compile operational program
Date: Sun, 12 Jul 2015 02:29:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 5.1.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: fvvnaqnd at grr dot la
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-66843-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-07/txt/msg00947.txt.bz2
Content-length: 1432

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

            Bug ID: 66843
           Summary: g++ outputting nonsense errors, won't compile
                    operational program
           Product: gcc
           Version: 5.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: fvvnaqnd at grr dot la
  Target Milestone: ---

I'm trying to compile this valid c++ code, as follows:

int main(int argc, char** argv) {
    dildo
    #define char int
    int *ptr = 0;
    return EXIT_SUCCESS;
}
=
while(1)
break;
/* https://www.gnu.org/licenses/gpl-3.0.en.html */
int i = 1 / 0;
goto dildo;

However, when trying to compile this with g++, the compiler spits out nonsense,
unintelligible errors:

shit.cpp: In function ‘int main(int, char**)’:
shit.cpp:2:5: error: ‘dildo’ was not declared in this scope
     dildo
     ^
shit.cpp:5:12: error: ‘EXIT_SUCCESS’ was not declared in this scope
     return EXIT_SUCCESS;
            ^
shit.cpp: At global scope:
shit.cpp:7:1: error: expected unqualified-id before ‘=’ token
 =
 ^
shit.cpp:11:11: warning: division by zero [-Wdiv-by-zero]
 int i = 1 / 0;
           ^
shit.cpp:12:1: error: expected unqualified-id before ‘goto’
 goto dildo;
 ^

Please Respond
>From gcc-bugs-return-492058-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Jul 12 04:51:16 2015
Return-Path: <gcc-bugs-return-492058-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 35368 invoked by alias); 12 Jul 2015 04:51:14 -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 35345 invoked by uid 48); 12 Jul 2015 04:51:07 -0000
From: "Casey at Carter dot net" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/66844] New: [c++-concepts] Requires-expression parameter with void type
Date: Sun, 12 Jul 2015 04:51:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 6.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: Casey at Carter dot net
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-66844-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/msg00948.txt.bz2
Content-length: 768

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

            Bug ID: 66844
           Summary: [c++-concepts] Requires-expression parameter with void
                    type
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: Casey at Carter dot net
  Target Milestone: ---

This ill-formed program compiles successfully:

template <class T, class U>
concept bool Same = __is_same_as(T, U);

template <class T>
concept bool C   requires (T t) {
    requires Same<decltype(t),void>;
  };

template <C>
constexpr bool is_c() { return true; }

static_assert(is_c<void>(), "");

int main() {}


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

* [Bug c++/65186] internal compiler error: in tsubst, at cp/pt.c:11738
  2015-02-24  8:07 [Bug c++/65186] New: internal compiler error: in tsubst, at cp/pt.c:11738 shum at canndrew dot org
                   ` (8 preceding siblings ...)
  2015-07-11 22:10 ` ppalka at gcc dot gnu.org
@ 2015-07-12  8:47 ` paolo.carlini at oracle dot com
  2015-07-12 22:30 ` ppalka at gcc dot gnu.org
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: paolo.carlini at oracle dot com @ 2015-07-12  8:47 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Hi Patrick. Opening a new bug certainly is OK, in particular in this case where
we failed to just simplify the testcase originally submitted. Thus, when your
patch goes in, just resolve this one as fixed and open a new one with the best
testcase (#3, #8, or something else) for it. Thanks again!


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

* [Bug c++/65186] internal compiler error: in tsubst, at cp/pt.c:11738
  2015-02-24  8:07 [Bug c++/65186] New: internal compiler error: in tsubst, at cp/pt.c:11738 shum at canndrew dot org
                   ` (9 preceding siblings ...)
  2015-07-12  8:47 ` paolo.carlini at oracle dot com
@ 2015-07-12 22:30 ` ppalka at gcc dot gnu.org
  2015-07-13 20:36 ` ppalka at gcc dot gnu.org
  2015-07-14  9:10 ` paolo.carlini at oracle dot com
  12 siblings, 0 replies; 14+ messages in thread
From: ppalka at gcc dot gnu.org @ 2015-07-12 22:30 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from Patrick Palka <ppalka at gcc dot gnu.org> ---
(In reply to Paolo Carlini from comment #11)
> Hi Patrick. Opening a new bug certainly is OK, in particular in this case
> where we failed to just simplify the testcase originally submitted. Thus,
> when your patch goes in, just resolve this one as fixed and open a new one
> with the best testcase (#3, #8, or something else) for it. Thanks again!

Thanks for your guidance.  I opened up PR66850 to track the issue in c3 and c8
separately.


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

* [Bug c++/65186] internal compiler error: in tsubst, at cp/pt.c:11738
  2015-02-24  8:07 [Bug c++/65186] New: internal compiler error: in tsubst, at cp/pt.c:11738 shum at canndrew dot org
                   ` (10 preceding siblings ...)
  2015-07-12 22:30 ` ppalka at gcc dot gnu.org
@ 2015-07-13 20:36 ` ppalka at gcc dot gnu.org
  2015-07-14  9:10 ` paolo.carlini at oracle dot com
  12 siblings, 0 replies; 14+ messages in thread
From: ppalka at gcc dot gnu.org @ 2015-07-13 20:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Author: ppalka
Date: Mon Jul 13 20:35:53 2015
New Revision: 225749

URL: https://gcc.gnu.org/viewcvs?rev=225749&root=gcc&view=rev
Log:
Fix PR c++/65186

gcc/cp/ChangeLog: 
        PR c++/65186
        * pt.c (invalid_nontype_parm_type_p): Accept a bound template
        template parm type under C++11 and later.

gcc/testsuite/ChangeLog:

        PR c++/65186
        * g++.dg/template/pr65186.C: New test.


Added:
    trunk/gcc/testsuite/g++.dg/template/pr65186.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/pt.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/65186] internal compiler error: in tsubst, at cp/pt.c:11738
  2015-02-24  8:07 [Bug c++/65186] New: internal compiler error: in tsubst, at cp/pt.c:11738 shum at canndrew dot org
                   ` (11 preceding siblings ...)
  2015-07-13 20:36 ` ppalka at gcc dot gnu.org
@ 2015-07-14  9:10 ` paolo.carlini at oracle dot com
  12 siblings, 0 replies; 14+ messages in thread
From: paolo.carlini at oracle dot com @ 2015-07-14  9:10 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |6.0

--- Comment #14 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Fixed.


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

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

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-24  8:07 [Bug c++/65186] New: internal compiler error: in tsubst, at cp/pt.c:11738 shum at canndrew dot org
2015-02-24  9:11 ` [Bug c++/65186] " jakub at gcc dot gnu.org
2015-02-24 12:18 ` rguenth at gcc dot gnu.org
2015-04-17 10:38 ` redi at gcc dot gnu.org
2015-04-17 10:40 ` redi at gcc dot gnu.org
2015-07-08 10:33 ` paolo.carlini at oracle dot com
2015-07-08 13:19 ` ppalka at gcc dot gnu.org
2015-07-11 13:50 ` ppalka at gcc dot gnu.org
2015-07-11 17:47 ` paolo.carlini at oracle dot com
2015-07-11 22:10 ` ppalka at gcc dot gnu.org
2015-07-12  8:47 ` paolo.carlini at oracle dot com
2015-07-12 22:30 ` ppalka at gcc dot gnu.org
2015-07-13 20:36 ` ppalka at gcc dot gnu.org
2015-07-14  9:10 ` paolo.carlini at oracle dot com

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).