public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "trippels at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/67100] ICE(in type_dependent_expression_p) on macro function + user defined literal Date: Mon, 03 Aug 2015 13:34:00 -0000 [thread overview] Message-ID: <bug-67100-4-rfKh5FeEzb@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-67100-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67100 Markus Trippelsdorf <trippels at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2015-08-03 CC| |trippels at gcc dot gnu.org Known to work| |5.2.0, 6.0 Ever confirmed|0 |1 Known to fail| |4.9.3 --- Comment #2 from Markus Trippelsdorf <trippels at gcc dot gnu.org> --- markus@x4 tmp % cat te.ii template <typename _Tp, _Tp...> struct A {}; template <char... chars> using _tstring = A<char, chars...>; template <typename T, T... chars> _tstring<chars...> operator""_tstr(); template <class, class, class> struct Dispatcher; template <class Caller, class Me> struct Dispatcher<Caller, decltype("go_up"_tstr), Me> { template <class> decltype(0) operator()(); }; int main() { Dispatcher<void, decltype("go_up"_tstr), void>(); } markus@x4 tmp % /usr/x86_64-pc-linux-gnu/gcc-bin/4.9.3/g++ -std=c++14 te.ii te.ii: In instantiation of ‘struct Dispatcher<void, A<char, 'g', 'o', '_', 'u', 'p'>, void>’: te.ii:9:61: required from here te.ii:6:36: internal compiler error: in type_dependent_expression_p, at cp/pt.c:21026 >From gcc-bugs-return-493938-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Aug 03 13:38:36 2015 Return-Path: <gcc-bugs-return-493938-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org> Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 56216 invoked by alias); 3 Aug 2015 13:38:36 -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 55851 invoked by uid 48); 3 Aug 2015 13:38:23 -0000 From: "miyuki at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/55095] Wshift-overflow Date: Mon, 03 Aug 2015 13:38:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.8.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: enhancement X-Bugzilla-Who: miyuki at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: mpolacek at gcc dot gnu.org X-Bugzilla-Target-Milestone: 6.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: <bug-55095-4-qSdKRux9Ka@http.gcc.gnu.org/bugzilla/> In-Reply-To: <bug-55095-4@http.gcc.gnu.org/bugzilla/> References: <bug-55095-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-08/txt/msg00080.txt.bz2 Content-length: 1631 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55095 Mikhail Maltsev <miyuki at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |miyuki at gcc dot gnu.org --- Comment #16 from Mikhail Maltsev <miyuki at gcc dot gnu.org> --- (In reply to Marek Polacek from comment #15) > Yea, I'm afraid we'll have to do what you suggest. And warn for the sign > bit only when -Wshift-overflow=2. Actually for me it looks like the correct way to handle this case. I mean, in c-family/c-common.c we have: /* Warn if signed left shift overflows. We don't warn about left-shifting 1 into the sign bit in C++14; cf. <http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3367.html#1457> ... And this check is implemented like this: /* Handle the left-shifting 1 into the sign bit case. */ if (integer_onep (op0) && compare_tree_int (op1, prec0 - 1) == 0) But in fact, even though the defect report explicitly mentions the "1 << x" case, the resolution is more general. It says: ...if E1 has a signed type and non-negative value, and E1 ⨯ 2^E2 is representable in the *corresponding unsigned type of the* result type, then that *value, converted to the result type,* is the resulting value; otherwise, the behavior is undefined. I.e., we should not warn for (0x1f << 27) either, at least when compiling C++14 code. But it seems reasonable to use the same logic for earlier dialects of C++ and C when -Wshift-overflow=1, as it is done now. >From gcc-bugs-return-493939-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Aug 03 13:56:04 2015 Return-Path: <gcc-bugs-return-493939-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org> Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 110356 invoked by alias); 3 Aug 2015 13:56:03 -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 110312 invoked by uid 55); 3 Aug 2015 13:56:00 -0000 From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c/67088] Incorrect location of error on invalid type used in bit-field declaration Date: Mon, 03 Aug 2015 13:56:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed 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: mpolacek at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: mpolacek at gcc dot gnu.org X-Bugzilla-Target-Milestone: 6.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: <bug-67088-4-bUqfzk0z2w@http.gcc.gnu.org/bugzilla/> In-Reply-To: <bug-67088-4@http.gcc.gnu.org/bugzilla/> References: <bug-67088-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-08/txt/msg00081.txt.bz2 Content-length: 626 https://gcc.gnu.org/bugzilla/show_bug.cgi?idg088 --- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> --- Author: mpolacek Date: Mon Aug 3 13:55:28 2015 New Revision: 226506 URL: https://gcc.gnu.org/viewcvs?rev"6506&root=gcc&view=rev Log: PR c/67088 * c-decl.c (check_bitfield_type_and_width): Add location parameter. Use it. (grokdeclarator): Pass LOC down to check_bitfield_type_and_width. * gcc.dg/pr67088.c: New test. Added: trunk/gcc/testsuite/gcc.dg/pr67088.c Modified: trunk/gcc/c/ChangeLog trunk/gcc/c/c-decl.c trunk/gcc/testsuite/ChangeLog
next prev parent reply other threads:[~2015-08-03 13:34 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2015-08-03 12:40 [Bug c++/67100] New: " tower120 at gmail dot com 2015-08-03 12:42 ` [Bug c++/67100] " tower120 at gmail dot com 2015-08-03 13:34 ` trippels at gcc dot gnu.org [this message] 2015-08-03 13:59 ` tower120 at gmail dot com 2015-08-19 9:37 ` mpolacek at gcc dot gnu.org
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-67100-4-rfKh5FeEzb@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: linkBe 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).