public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/63889] New: Ice with redundant static in class scope constexpr variable template.
@ 2014-11-15 15:03 emsr at gcc dot gnu.org
  2014-11-15 18:48 ` [Bug c++/63889] " daniel.kruegler at googlemail dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: emsr at gcc dot gnu.org @ 2014-11-15 15:03 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 63889
           Summary: Ice with redundant static in class scope constexpr
                    variable template.
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: emsr at gcc dot gnu.org

Created attachment 33984
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33984&action=edit
Class snippet demonstrating the ICE.

This little test ices instead of issuing a warning (I'm not even sure it should
error) if a constexpr variable template member is declared static.

>From N3651 "A variable template at class scope is a static data member
template."

So the 'static', is at worst, redundant.


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

* [Bug c++/63889] Ice with redundant static in class scope constexpr variable template.
  2014-11-15 15:03 [Bug c++/63889] New: Ice with redundant static in class scope constexpr variable template emsr at gcc dot gnu.org
@ 2014-11-15 18:48 ` daniel.kruegler at googlemail dot com
  2014-12-03  9:43 ` [Bug c++/63889] [5 Regression] " mpolacek at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2014-11-15 18:48 UTC (permalink / raw)
  To: gcc-bugs

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

Daniel Krügler <daniel.kruegler at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel.kruegler@googlemail.
                   |                            |com

--- Comment #1 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
The code example looks invalid for several reasons, but the following is a
simplified example that is free of library dependencies and ICEs as well:

//-----------------
template<class T>
struct A
{
  template<class>
  static constexpr bool is_ok = true;

  template<bool v = is_ok<T>>
  A(T) { }
};

A<int> p(42);
//-----------------

For gcc 5.0.0 20141115 (experimental) using the flags

-Wall -Wextra -std=c++1y -pedantic 

I get:

"prog.cc:7:21: internal compiler error: in retrieve_specialization, at
cp/pt.c:1047 template<bool v = is_ok<T>> ^ 0x5d8a93 retrieve_specialization
/home/heads/gcc/gcc-source/gcc/cp/pt.c:1047 0x5e17de instantiate_template_1
/home/heads/gcc/gcc-source/gcc/cp/pt.c:15821 0x5e17de
instantiate_template(tree_node*, tree_node*, int)
/home/heads/gcc/gcc-source/gcc/cp/pt.c:15915 0x6796c5
finish_template_variable(tree_node*)
/home/heads/gcc/gcc-source/gcc/cp/semantics.c:2454 0x6796c5
finish_id_expression(tree_node*, tree_node*, tree_node*, cp_id_kind*, bool,
bool, bool*, bool, bool, bool, bool, char const**, unsigned int)
/home/heads/gcc/gcc-source/gcc/cp/semantics.c:3551 0x628e4b
cp_parser_primary_expression /home/heads/gcc/gcc-source/gcc/cp/parser.c:4727
0x62c968 cp_parser_postfix_expression
/home/heads/gcc/gcc-source/gcc/cp/parser.c:6089 0x6343ed
cp_parser_unary_expression /home/heads/gcc/gcc-source/gcc/cp/parser.c:7370
0x6350e4 cp_parser_binary_expression
/home/heads/gcc/gcc-source/gcc/cp/parser.c:8104 0x63564f
cp_parser_assignment_expression /home/heads/gcc/gcc-source/gcc/cp/parser.c:8347
0x635ae5 cp_parser_constant_expression
/home/heads/gcc/gcc-source/gcc/cp/parser.c:8593 0x63753a
cp_parser_default_argument /home/heads/gcc/gcc-source/gcc/cp/parser.c:19052
0x6314b9 cp_parser_parameter_declaration
/home/heads/gcc/gcc-source/gcc/cp/parser.c:18968 0x63d40b
cp_parser_template_parameter /home/heads/gcc/gcc-source/gcc/cp/parser.c:13289
0x63d40b cp_parser_template_parameter_list
/home/heads/gcc/gcc-source/gcc/cp/parser.c:13192 0x644991
cp_parser_template_declaration_after_export
/home/heads/gcc/gcc-source/gcc/cp/parser.c:23445 0x6468ae
cp_parser_member_declaration /home/heads/gcc/gcc-source/gcc/cp/parser.c:20601
0x62e53c cp_parser_member_specification_opt
/home/heads/gcc/gcc-source/gcc/cp/parser.c:20528 0x62e53c
cp_parser_class_specifier_1 /home/heads/gcc/gcc-source/gcc/cp/parser.c:19720
0x62e53c cp_parser_class_specifier
/home/heads/gcc/gcc-source/gcc/cp/parser.c:19956 Please submit a full bug
report, with preprocessed source if appropriate. Please include the complete
backtrace with any bug report. See <http://gcc.gnu.org/bugs.html> for
instructions."
>From gcc-bugs-return-466912-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Nov 15 19:23:39 2014
Return-Path: <gcc-bugs-return-466912-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 25119 invoked by alias); 15 Nov 2014 19:23:39 -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 25095 invoked by uid 48); 15 Nov 2014 19:23:35 -0000
From: "arekm at maven dot pl" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug ada/63656] a-tags.adb:82:04: warning: types for unchecked conversion have different sizes
Date: Sat, 15 Nov 2014 19:23:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: ada
X-Bugzilla-Version: 4.9.2
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: arekm at maven dot pl
X-Bugzilla-Status: RESOLVED
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_status resolution
Message-ID: <bug-63656-4-iV1sWAnaNI@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-63656-4@http.gcc.gnu.org/bugzilla/>
References: <bug-63656-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-11/txt/msg01384.txt.bz2
Content-length: 515

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

Arkadiusz Miskiewicz <arekm at maven dot pl> changed:

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

--- Comment #4 from Arkadiusz Miskiewicz <arekm at maven dot pl> ---
Invalid system.ads was used (sparc64 version) due to local broken patch (even
on x86_64).


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

* [Bug c++/63889] [5 Regression] Ice with redundant static in class scope constexpr variable template.
  2014-11-15 15:03 [Bug c++/63889] New: Ice with redundant static in class scope constexpr variable template emsr at gcc dot gnu.org
  2014-11-15 18:48 ` [Bug c++/63889] " daniel.kruegler at googlemail dot com
@ 2014-12-03  9:43 ` mpolacek at gcc dot gnu.org
  2014-12-10 15:26 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2014-12-03  9:43 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-12-03
                 CC|                            |mpolacek at gcc dot gnu.org
   Target Milestone|---                         |5.0
            Summary|Ice with redundant static   |[5 Regression] Ice with
                   |in class scope constexpr    |redundant static in class
                   |variable template.          |scope constexpr variable
                   |                            |template.
     Ever confirmed|0                           |1

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Confirmed.


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

* [Bug c++/63889] [5 Regression] Ice with redundant static in class scope constexpr variable template.
  2014-11-15 15:03 [Bug c++/63889] New: Ice with redundant static in class scope constexpr variable template emsr at gcc dot gnu.org
  2014-11-15 18:48 ` [Bug c++/63889] " daniel.kruegler at googlemail dot com
  2014-12-03  9:43 ` [Bug c++/63889] [5 Regression] " mpolacek at gcc dot gnu.org
@ 2014-12-10 15:26 ` rguenth at gcc dot gnu.org
  2014-12-15 16:39 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-12-10 15:26 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-invalid-code
           Priority|P3                          |P1


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

* [Bug c++/63889] [5 Regression] Ice with redundant static in class scope constexpr variable template.
  2014-11-15 15:03 [Bug c++/63889] New: Ice with redundant static in class scope constexpr variable template emsr at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2014-12-10 15:26 ` rguenth at gcc dot gnu.org
@ 2014-12-15 16:39 ` jakub at gcc dot gnu.org
  2014-12-18 14:50 ` ktietz at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-12-15 16:39 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
ICEs since r213641.


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

* [Bug c++/63889] [5 Regression] Ice with redundant static in class scope constexpr variable template.
  2014-11-15 15:03 [Bug c++/63889] New: Ice with redundant static in class scope constexpr variable template emsr at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2014-12-15 16:39 ` jakub at gcc dot gnu.org
@ 2014-12-18 14:50 ` ktietz at gcc dot gnu.org
  2015-01-27 16:27 ` jason at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ktietz at gcc dot gnu.org @ 2014-12-18 14:50 UTC (permalink / raw)
  To: gcc-bugs

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

Kai Tietz <ktietz at gcc dot gnu.org> changed:

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

--- Comment #4 from Kai Tietz <ktietz at gcc dot gnu.org> ---
Issue is that we don't check for static function for template-parameter-count. 
So for this sample tmpl has 2 arguments, but in fact it has just 1.
Not sure where we add this additional argument. We see for the template-decl
'template <class T> template <class>' ...
By allowing args being less then expected template arguments, issue is fixed. 
But in fact we should check template-params - (is_static ? 1 : 0) ... or
something like this.


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

* [Bug c++/63889] [5 Regression] Ice with redundant static in class scope constexpr variable template.
  2014-11-15 15:03 [Bug c++/63889] New: Ice with redundant static in class scope constexpr variable template emsr at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2014-12-18 14:50 ` ktietz at gcc dot gnu.org
@ 2015-01-27 16:27 ` jason at gcc dot gnu.org
  2015-01-27 19:17 ` jason at gcc dot gnu.org
  2015-01-27 19:19 ` jason at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2015-01-27 16:27 UTC (permalink / raw)
  To: gcc-bugs

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

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

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


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

* [Bug c++/63889] [5 Regression] Ice with redundant static in class scope constexpr variable template.
  2014-11-15 15:03 [Bug c++/63889] New: Ice with redundant static in class scope constexpr variable template emsr at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2015-01-27 16:27 ` jason at gcc dot gnu.org
@ 2015-01-27 19:17 ` jason at gcc dot gnu.org
  2015-01-27 19:19 ` jason at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2015-01-27 19:17 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Tue Jan 27 19:16:51 2015
New Revision: 220183

URL: https://gcc.gnu.org/viewcvs?rev=220183&root=gcc&view=rev
Log:
    PR c++/63889
    * pt.c (finish_template_variable): Move from semantics.c.
    Handle multiple template arg levels.  Handle coercion here.
    (lookup_template_variable): Not here.

Added:
    trunk/gcc/testsuite/g++.dg/cpp1y/var-templ22.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/pt.c
    trunk/gcc/cp/semantics.c


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

* [Bug c++/63889] [5 Regression] Ice with redundant static in class scope constexpr variable template.
  2014-11-15 15:03 [Bug c++/63889] New: Ice with redundant static in class scope constexpr variable template emsr at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2015-01-27 19:17 ` jason at gcc dot gnu.org
@ 2015-01-27 19:19 ` jason at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2015-01-27 19:19 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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


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

end of thread, other threads:[~2015-01-27 19:19 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-15 15:03 [Bug c++/63889] New: Ice with redundant static in class scope constexpr variable template emsr at gcc dot gnu.org
2014-11-15 18:48 ` [Bug c++/63889] " daniel.kruegler at googlemail dot com
2014-12-03  9:43 ` [Bug c++/63889] [5 Regression] " mpolacek at gcc dot gnu.org
2014-12-10 15:26 ` rguenth at gcc dot gnu.org
2014-12-15 16:39 ` jakub at gcc dot gnu.org
2014-12-18 14:50 ` ktietz at gcc dot gnu.org
2015-01-27 16:27 ` jason at gcc dot gnu.org
2015-01-27 19:17 ` jason at gcc dot gnu.org
2015-01-27 19:19 ` 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).