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]

[C++ PATCH] Diagnose invalid uses of auto type specifier (PR c++/37962)


Hi!

Attached are two alternative patches to diagnose (and avoid ICEing) on
invalid uses of auto type specifier.  C++0x enumerates a few places where
auto type specifier may be used and says everything else is ill-formed.

The first patch perhaps gives nicer diagnostics (often emits fewer errors
after reporting invalid use of %<auto%>), but is larger, has to touch more
places.

The second patch is much shorter (basically just changes cp_parser_type_id),
but has 2 FAILs in the new auto9.C testcase I haven't been able to tackle:
it still silently accepts __typeof__ (auto) v; or __typeof__ (auto *) w;
(the type is error_mark_node, but due to lots of tentative parsing no error
is ever reported).

	Jakub

Attachment: Y094h
Description: Text document

Attachment: Y094i
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]