This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
struct A { typedef int X; };
struct __attribute__((unused)) A::X;An appropriate error message about the invalid use of "A::X" was being issued from check_elaborated_type_specifier but it's called, cp_parser_elaborated_type_specifier wasn't checking the return value to ensure it's validity before continuing, causing a segmentation fault later on.
The attach patch fixes this by checking the return value of check_elaborated_type_specifier from in cp_parser_elaborated_type_specifier and to return error_mark_node if the call failed in line with the existing error handling code in cp_parser_elaborated_type_specifier.
Bootstrapped and regression tested with no new failures on i686-pc-linux-gnu. Ok for mainline and release branches?
Cheers, Lee.
cp/ 2006-12-06 Lee Millward <lee.millward@codesourcery.com>
PR c++/29980
* cp_parser_elaborated_type_specifier: Check
the return value of check_elaborated_type_specifier.testsuite/
2006-12-06 Lee Millward <lee.millward@codesourcery.com>
PR c++/29980
* g++.dg/ext/attrib27.C: New test.
* g++.dg/parse/struct-as-enum1.C: Adjust error markers.
* g++.dg/parse/typedef5.C: Likewise.
Attachment:
pr29980.txt
Description: Text document
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |