From patchwork Sat Jun 4 12:59:57 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 98726 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id EB449B6FC3 for ; Sat, 4 Jun 2011 23:00:16 +1000 (EST) Received: (qmail 12047 invoked by alias); 4 Jun 2011 13:00:14 -0000 Received: (qmail 12030 invoked by uid 22791); 4 Jun 2011 13:00:12 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RFC_ABUSE_POST X-Spam-Check-By: sourceware.org Received: from mail-px0-f176.google.com (HELO mail-px0-f176.google.com) (209.85.212.176) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 04 Jun 2011 12:59:58 +0000 Received: by pxi11 with SMTP id 11so1547548pxi.21 for ; Sat, 04 Jun 2011 05:59:57 -0700 (PDT) MIME-Version: 1.0 Received: by 10.142.75.3 with SMTP id x3mr429945wfa.238.1307192397458; Sat, 04 Jun 2011 05:59:57 -0700 (PDT) Received: by 10.142.106.17 with HTTP; Sat, 4 Jun 2011 05:59:57 -0700 (PDT) Date: Sat, 4 Jun 2011 13:59:57 +0100 Message-ID: Subject: [patch] add test for PR c++/33840 From: Jonathan Wakely To: gcc-patches , Jason Merrill Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org The code in the PR is correctly rejected now, this adds a test to prevent regressions so the PR can be closed. 2011-06-04 Jonathan Wakely PR c++/33840 * g++.dg/diagnostic/bitfld2.C: New. Tested x86_64-linux, ok for trunk and 4.6? Index: testsuite/g++.dg/diagnostic/bitfld2.C =================================================================== --- testsuite/g++.dg/diagnostic/bitfld2.C (revision 0) +++ testsuite/g++.dg/diagnostic/bitfld2.C (revision 0) @@ -0,0 +1,9 @@ +// PR c++/33840 +// { dg-do compile } + +template struct A +{ + struct {} : 2; // { dg-error "expected ';' after struct" } +}; +// { dg-error "ISO C.. forbids declaration" "" { target *-*-* } 6 } +// { dg-error "ISO C.. prohibits anonymous" "" { target *-*-* } 6 }