llvm-project/clang/lib/Parse
Douglas Gregor 82ac25e4a7 Unify the code for defining tags in C and C++, so that we always
introduce a Scope for the body of a tag. This reduces the number of
semantic differences between C and C++ structs and unions, and will
help with other features (e.g., anonymous unions) in C. Some important
points:

  - Fields are now in the "member" namespace (IDNS_Member), to keep
    them separate from tags and ordinary names in C. See the new test
    in Sema/member-reference.c for an example of why this matters. In
    C++, ordinary and member name lookup will find members in both the
    ordinary and member namespace, so the difference between
    IDNS_Member and IDNS_Ordinary is erased by Sema::LookupDecl (but
    only in C++!). 
  - We always introduce a Scope and push a DeclContext when we're
    defining a tag, in both C and C++. Previously, we had different
    actions and different Scope/CurContext behavior for enums, C
    structs/unions, and C++ structs/unions/classes. Now, it's one pair
    of actions. (Yay!)

There's still some fuzziness in the handling of struct/union/enum
definitions within other struct/union/enum definitions in C. We'll
need to do some more cleanup to eliminate some reliance on CurContext
before we can solve this issue for real. What we want is for something
like this:

  struct X {
    struct T { int x; } t;
  };

to introduce T into translation unit scope (placing it at the
appropriate point in the IdentifierResolver chain, too), but it should
still have struct X as its lexical declaration
context. PushOnScopeChains isn't smart enough to do that yet, though,
so there's a FIXME test in nested-redef.c

llvm-svn: 61940
2009-01-08 20:45:30 +00:00
..
AstGuard.h Convert a few Stmt actions to smart pointers. 2008-12-21 12:04:03 +00:00
AttributeList.cpp Semantics of @protocol attributes. 2008-12-17 01:07:27 +00:00
CMakeLists.txt Update cmake build; patch by Csaba Hruska. 2008-12-02 16:23:30 +00:00
DeclSpec.cpp Diagnose declarations that don't declare anything, and fix PR3020. 2008-12-28 15:28:59 +00:00
ExtensionRAIIObject.h implement a couple fixme's by implementing __extension__ properly. 2008-10-20 06:45:43 +00:00
Makefile Make a major restructuring of the clang tree: introduce a top-level 2008-03-15 23:59:48 +00:00
MinimalAction.cpp Ultrasimplistic sketch for the parsing of C++ template-ids. This won't 2008-12-18 19:37:40 +00:00
ParseCXXInlineMethods.cpp Delay parsing of default arguments of member functions until the class 2008-12-16 21:30:33 +00:00
ParseDecl.cpp Unify the code for defining tags in C and C++, so that we always 2009-01-08 20:45:30 +00:00
ParseDeclCXX.cpp Unify the code for defining tags in C and C++, so that we always 2009-01-08 20:45:30 +00:00
ParseExpr.cpp rename tok::annot_qualtypename -> tok::annot_typename, which is both 2009-01-06 05:06:21 +00:00
ParseExprCXX.cpp Add whitespace to silence the following warning in a Release build: warning: suggest a space before ';' or explicit braces around empty body in 'while' statement 2009-01-06 19:17:58 +00:00
ParseInit.cpp Convert remaining expression parsers to smart pointers. Now on to the Action connection. 2008-12-13 15:32:12 +00:00
ParseObjc.cpp Unify the code for defining tags in C and C++, so that we always 2009-01-08 20:45:30 +00:00
ParsePragma.cpp Modify the move emulation according to the excellent design of Howard Hinnant. Makes for much nicer syntax when smart pointers are used consistently. Also, start converting internal argument passing of Parser to smart pointers. 2008-12-10 00:02:53 +00:00
ParsePragma.h Add Parser support for #pragma pack 2008-10-04 19:21:03 +00:00
ParseStmt.cpp Convert a two more statement actions to smart pointers. 2008-12-28 16:13:43 +00:00
ParseTemplate.cpp rename tok::annot_qualtypename -> tok::annot_typename, which is both 2009-01-06 05:06:21 +00:00
ParseTentative.cpp Another tweak to handle the MS extensions (<rdar://problem/5956221>). 2009-01-06 19:34:12 +00:00
Parser.cpp rename MaybeParseCXXScopeSpecifier -> ParseOptionalCXXScopeSpecifier and 2009-01-06 06:59:53 +00:00