[cfe-dev] C++ PATCH: Basic inheritance syntax, semantics

Doug Gregor doug.gregor at gmail.com
Sun Apr 13 10:54:24 PDT 2008


This patch adds very basic support for parsing and type-checking class
inheritance in C++. It'll parse the base-specifier list, e.g.,

  class D : public B1, virtual public B2 { };

and do some of the simpler semantic checks (B1 and B2 are classes;
they aren't unions or incomplete types, etc). This patch *does not*
introduce any representation of base classes into the AST. That (along
with the semantic checks it enables) will be a follow-on patch.

The only interesting part of this patch is that I've completely
removed Parser::ParseStructUnionSpecifier in favor of the new
Parser::ParseClassSpecifier. The latter parses C++ class specifiers,
which are a superset of the C99 struct-or-union-specifier. So there's
no reason to keep around the C-only ParseStructOrUnionSpecifier.

This patch depends on my pending patches to add support for parsing
classes and for name lookup of class names.

  - Doug
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clang-inherit.patch
Type: text/x-patch
Size: 20093 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20080413/58a1e37f/attachment.bin>


More information about the cfe-dev mailing list