public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/51826] [4.6 Regression] internal compiler error: in convert_nontype_argument, at cp/pt.c:5408
Date: Thu, 12 Jan 2012 09:17:00 -0000	[thread overview]
Message-ID: <bug-51826-4-u7zgY4flMX@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-51826-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51826

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
      Known to work|                            |4.5.3, 4.7.0
           Keywords|                            |ice-on-invalid-code
   Last reconfirmed|                            |2012-01-12
     Ever Confirmed|0                           |1
            Summary|internal compiler error: in |[4.6 Regression] internal
                   |convert_nontype_argument,   |compiler error: in
                   |at cp/pt.c:5408             |convert_nontype_argument,
                   |                            |at cp/pt.c:5408
   Target Milestone|---                         |4.6.3
      Known to fail|                            |4.6.2

--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-01-12 09:17:30 UTC ---
Confirmed.

> g++ -S t.C 
t.C: In function 'int main(int, char**)':
t.C:8:26: error: cast from 'const char*' to 'int' loses precision
[-fpermissive]
t.C:8:31: error: '(int)((long int)"123")' is not a constant expression
t.C:8:31: note: in template argument for type 'int' 

> g++ -S t.C -m32
t.C: In function 'int main(int, char**)':
t.C:8:31: internal compiler error: in convert_nontype_argument, at cp/pt.c:5408
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

On trunk:

> g++ -S t.C -m32 -B /abuild/rguenther/trunk-g/gcc
t.C: In function 'int main(int, char**)':
t.C:8:31: error: conversion from pointer type 'const char (*)[4]' to arithmetic
type 'int' in a constant-expression
t.C:8:31: note: in template argument for type 'int' 

so it's invalid source, fixed on trunk.  4.5 says

g++ -S t.C -m32
t.C: In function 'int main(int, char**)':
t.C:8:31: error: '(int)"123"' is not a valid template argument for type 'int'
because it is a non-constant expression


  reply	other threads:[~2012-01-12  9:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-11 19:03 [Bug c++/51826] New: " just.serejko at gmail dot com
2012-01-12  9:17 ` rguenth at gcc dot gnu.org [this message]
2012-03-01 14:58 ` [Bug c++/51826] [4.6 Regression] " jakub at gcc dot gnu.org
2012-08-25 18:37 ` paolo.carlini at oracle dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-51826-4-u7zgY4flMX@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).