Bug 55368 - Comma before semicolon in struct definition is not rejected
Summary: Comma before semicolon in struct definition is not rejected
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.7.2
: P3 normal
Target Milestone: 4.8.0
Assignee: Paolo Carlini
URL:
Keywords: accepts-invalid
Depends on:
Blocks:
 
Reported: 2012-11-17 16:46 UTC by Joerg Sonnenberger
Modified: 2012-11-19 14:42 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2012-11-18 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joerg Sonnenberger 2012-11-17 16:46:08 UTC
Test case:

struct A { struct B *C,; };
Comment 1 Paolo Carlini 2012-11-19 12:11:06 UTC
On it.
Comment 2 paolo@gcc.gnu.org 2012-11-19 14:41:33 UTC
Author: paolo
Date: Mon Nov 19 14:41:26 2012
New Revision: 193624

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=193624
Log:
/cp
2012-11-19  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/55368
	* parser.c (cp_parser_member_declaration): Emit an error in case
	of stray comma at end of member declaration.

/testsuite
2012-11-19  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/55368
	* g++.dg/parse/struct-5.C: New.

Added:
    trunk/gcc/testsuite/g++.dg/parse/struct-5.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/parser.c
    trunk/gcc/testsuite/ChangeLog
Comment 3 Paolo Carlini 2012-11-19 14:42:48 UTC
Fixed for 4.8.0.