public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/66712] New: [concepts] variadic concepts cause havoc
@ 2015-06-30 18:55 eric.niebler at gmail dot com
  2015-07-03 17:46 ` [Bug c++/66712] " jason at gcc dot gnu.org
  2015-07-03 17:47 ` jason at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: eric.niebler at gmail dot com @ 2015-06-30 18:55 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 5936 bytes --]

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

            Bug ID: 66712
           Summary: [concepts] variadic concepts cause havoc
           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...Args>
concept bool _Constructible_ =
  requires (Args&&...args)
  {
    T{ ((Args&&)(args))... };
  };

template <class T, class...Args>
constexpr bool _constructible_() { return false; }

_Constructible_{T, ...Args...}
constexpr bool _constructible_() { return true; }

struct S
{
  S(int, char const *);
};

int main()
{
  static_assert(_constructible_<S, int, char const *>(), "");
}


Result:

temp.cpp: In function ‘int main()’:
temp.cpp:22:55: internal compiler error: tree check: expected record_type or
union_type or qual_union_type, have template_type_parm in lookup_base, at
cp/search.c:224
   static_assert(_constructible_<S, int, char const *>(), "");
                                                       ^

temp.cpp:22:55: internal compiler error: Aborted
g++: internal compiler error: Aborted (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


The trouble with variadic concepts is a blocker for STL2.
>From gcc-bugs-return-491082-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Jun 30 18:55:24 2015
Return-Path: <gcc-bugs-return-491082-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 115684 invoked by alias); 30 Jun 2015 18:55:24 -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 110129 invoked by uid 48); 30 Jun 2015 18:55:21 -0000
From: "steffen.muething at iwr dot uni-heidelberg.de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/66711] New: GCC does not correctly restore diagnostic state after pragma GCC diagnostic pop with -Werror
Date: Tue, 30 Jun 2015 18:55: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: steffen.muething at iwr dot uni-heidelberg.de
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 attachments.created
Message-ID: <bug-66711-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-06/txt/msg03414.txt.bz2
Content-length: 2456

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

            Bug ID: 66711
           Summary: GCC does not correctly restore diagnostic state after
                    pragma GCC diagnostic pop with -Werror
           Product: gcc
           Version: 5.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: steffen.muething at iwr dot uni-heidelberg.de
  Target Milestone: ---

Created attachment 35880
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id5880&actioníit
MWE, compile with "gcc -Wextra -Werror wrong-diagnostic-pop.c"

GCC 5.1.0 fails to correctly restore the diagnostics state after a "#pragma GCC
diagnostic pop" if the program was compiled with -Werror: Instead of emitting
an error, the compiler insteads issues a warning after the pragma.

I've attached a simple example file. When compiled with "-Wextra -Werror", I'd
expect the output:

"""
error.cc: In function 'int main()':
error.cc:9:10: error: comparison between signed and unsigned integer
expressions [-Werror=sign-compare]
   x += x < y ? 1 : 0;
          ^
error.cc:18:10: error: comparison between signed and unsigned integer
expressions [-Werror=sign-compare]
   x += x < y ? 1 : 0;
          ^
cc1plus: all warnings being treated as errors
"""

But I get the following:

"""
error.cc: In function 'int main()':
error.cc:9:10: error: comparison between signed and unsigned integer
expressions [-Werror=sign-compare]
   x += x < y ? 1 : 0;
          ^
error.cc:18:10: warning: comparison between signed and unsigned integer
expressions [-Wsign-compare]
   x += x < y ? 1 : 0;
          ^
cc1plus: all warnings being treated as errors
"""

The second diagnostic was turned into a warning. All older versions of GCC that
I have available and that support diagnostic push/pop (4.6.4, 4.7.4, 4.8.4,
4.9.2) handle this correctly and issue an error in both cases. Example output
from GCC 4.9.2:

"""
wrong-diagnostic-pop.c: In function 'main':
wrong-diagnostic-pop.c:9:10: error: comparison between signed and unsigned
integer expressions [-Werror=sign-compare]
   x += x < y ? 1 : 0;
          ^
wrong-diagnostic-pop.c:18:10: error: comparison between signed and unsigned
integer expressions [-Werror=sign-compare]
   x += x < y ? 1 : 0;
          ^
cc1: all warnings being treated as errors
"""

The problem is also present in the C++ frontend.


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

* [Bug c++/66712] [concepts] variadic concepts cause havoc
  2015-06-30 18:55 [Bug c++/66712] New: [concepts] variadic concepts cause havoc eric.niebler at gmail dot com
@ 2015-07-03 17:46 ` jason at gcc dot gnu.org
  2015-07-03 17:47 ` jason at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: jason at gcc dot gnu.org @ 2015-07-03 17:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Fri Jul  3 17:46:04 2015
New Revision: 225399

URL: https://gcc.gnu.org/viewcvs?rev=225399&root=gcc&view=rev
Log:
        PR c++/66712
        * gcc/cp/pt.c (tsubst_pack_expansion): Use
        retrieve_local_specialization for requires-expression parameters.
        (argument_pack_element_is_expansion_p): A decl pack is an expansion.

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


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

* [Bug c++/66712] [concepts] variadic concepts cause havoc
  2015-06-30 18:55 [Bug c++/66712] New: [concepts] variadic concepts cause havoc eric.niebler at gmail dot com
  2015-07-03 17:46 ` [Bug c++/66712] " jason at gcc dot gnu.org
@ 2015-07-03 17:47 ` jason at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: jason at gcc dot gnu.org @ 2015-07-03 17:47 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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


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

end of thread, other threads:[~2015-07-03 17:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-30 18:55 [Bug c++/66712] New: [concepts] variadic concepts cause havoc eric.niebler at gmail dot com
2015-07-03 17:46 ` [Bug c++/66712] " jason at gcc dot gnu.org
2015-07-03 17:47 ` 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).