Skip to content
  1. Mar 27, 2009
  2. Mar 26, 2009
  3. Mar 25, 2009
  4. Mar 24, 2009
    • Douglas Gregor's avatar
      Make sure to use RequireCompleteType rather than testing for · ac1fb65d
      Douglas Gregor authored
      incomplete types. RequireCompleteType is needed when the type may be
      completed by instantiating a template.
      
      llvm-svn: 67643
      ac1fb65d
    • Anders Carlsson's avatar
      More work on diagnosing abstract classes. We can now handle cases like · b5a27b46
      Anders Carlsson authored
      class C {
        void g(C c);
      
        virtual void f() = 0;
      };
      
      In this case, C is not known to be abstract when doing semantic analysis on g. This is done by recursively traversing the abstract class and checking the types of member functions. 
      
      llvm-svn: 67594
      b5a27b46
    • Douglas Gregor's avatar
      Template instantiation for the declarations of member functions within · f4f296de
      Douglas Gregor authored
      a class template. At present, we can only instantiation normal
      methods, but not constructors, destructors, or conversion operators.
      
      As ever, this contains a bit of refactoring in Sema's type-checking. In
      particular:
      
        - Split ActOnFunctionDeclarator into ActOnFunctionDeclarator
          (handling the declarator itself) and CheckFunctionDeclaration
          (checking for the the function declaration), the latter of which
          is also used by template instantiation.
        - We were performing the adjustment of function parameter types in
          three places; collect those into a single new routine.
        - When the type of a parameter is adjusted, allocate an
          OriginalParmVarDecl to keep track of the type as it was written.
        - Eliminate a redundant check for out-of-line declarations of member
          functions; hide more C++-specific checks on function declarations
          behind if(getLangOptions().CPlusPlus).
      
      llvm-svn: 67575
      f4f296de
  5. Mar 23, 2009
  6. Mar 22, 2009
  7. Mar 19, 2009
    • Douglas Gregor's avatar
      Variables marked as "extern" can actually have internal linkage if · 3731162a
      Douglas Gregor authored
      there is a previous declaration marked "static". This fixes PR3645.
      
      llvm-svn: 67336
      3731162a
    • Douglas Gregor's avatar
      Add a clarifying comment about HasPrototype's computation · 2797d329
      Douglas Gregor authored
      llvm-svn: 67316
      2797d329
    • Douglas Gregor's avatar
      If a function is declared as, e.g., · 3729f240
      Douglas Gregor authored
        F f;
      
      where F is a typedef of a function type, then the function "f" has a
      prototype. This is a slight tweak to Chris's suggested fix in
      PR3817. Fixes PR3817 and PR3840.
      
      llvm-svn: 67313
      3729f240
    • Douglas Gregor's avatar
      Introduce a new expression type, UnresolvedDeclRefExpr, that describes · 90a1a651
      Douglas Gregor authored
      dependent qualified-ids such as
      
        Fibonacci<N - 1>::value
      
      where N is a template parameter. These references are "unresolved"
      because the name is dependent and, therefore, cannot be resolved to a
      declaration node (as we would do for a DeclRefExpr or
      QualifiedDeclRefExpr). UnresolvedDeclRefExprs instantiate to
      DeclRefExprs, QualifiedDeclRefExprs, etc.
      
      Also, be a bit more careful about keeping only a single set of
      specializations for a class template, and instantiating from the
      definition of that template rather than a previous declaration. In
      general, we need a better solution for this for all TagDecls, because
      it's too easy to accidentally look at a declaration that isn't the
      definition.
      
      We can now process a simple Fibonacci computation described as a
      template metaprogram.
      
      llvm-svn: 67308
      90a1a651
    • Douglas Gregor's avatar
      Extend the use of QualifiedNameType to the creation of class template · e177b725
      Douglas Gregor authored
      specialization names. This way, we keep track of sugared types like
      
        std::vector<Real>
      
      I believe we are now using QualifiedNameTypes everywhere we can. Next
      step: QualifiedDeclRefExprs.
      
      llvm-svn: 67268
      e177b725
    • Douglas Gregor's avatar
      Introduce a representation for types that we referred to via a · 5253768a
      Douglas Gregor authored
      qualified name, e.g., 
      
        foo::x
      
      so that we retain the nested-name-specifier as written in the source
      code and can reproduce that qualified name when printing the types
      back (e.g., in diagnostics). This is PR3493, which won't be complete
      until finished the other tasks mentioned near the end of this commit.
      
      The parser's representation of nested-name-specifiers, CXXScopeSpec,
      is now a bit fatter, because it needs to contain the scopes that
      precede each '::' and keep track of whether the global scoping
      operator '::' was at the beginning. For example, we need to keep track
      of the leading '::', 'foo', and 'bar' in
       
        ::foo::bar::x
      
      The Action's CXXScopeTy * is no longer a DeclContext *. It's now the
      opaque version of the new NestedNameSpecifier, which contains a single
      component of a nested-name-specifier (either a DeclContext * or a Type
      *, bitmangled). 
      
      The new sugar type QualifiedNameType composes a sequence of
      NestedNameSpecifiers with a representation of the type we're actually
      referring to. At present, we only build QualifiedNameType nodes within
      Sema::getTypeName. This will be extended to other type-constructing
      actions (e.g., ActOnClassTemplateId).
      
      Also on the way: QualifiedDeclRefExprs will also store a sequence of
      NestedNameSpecifiers, so that we can print out the property
      nested-name-specifier. I expect to also use this for handling
      dependent names like Fibonacci<I - 1>::value.
      
      llvm-svn: 67265
      5253768a
  8. Mar 18, 2009
  9. Mar 17, 2009
    • Douglas Gregor's avatar
      Implement instantiation of enums within class templates. This isn't · 954f6b27
      Douglas Gregor authored
      quite as great as it sounds, because, while we can refer to the
      enumerator values outside the template, e.g.,
      
        adder<long, 3, 4>::value
      
      we can't yet refer to them with dependent names, so no Fibonacci
      (yet). 
      
      InstantiateClassTemplateSpecialization is getting messy; next commit
      will put it into a less-ugly state.
      
      llvm-svn: 67092
      954f6b27
  10. Mar 16, 2009
  11. Mar 13, 2009
  12. Mar 12, 2009
  13. Mar 11, 2009
  14. Mar 10, 2009
    • Douglas Gregor's avatar
      Partial fix for PR3310, concerning type-checking for tentative · 81457423
      Douglas Gregor authored
      definitions. We were rejecting tentative definitions of incomplete
      (which is bad), and now we don't.
      
      This fix is partial because we don't do the end-of-translation-unit
      initialization for tentative definitions that don't ever have any
      initializers specified.
      
      llvm-svn: 66584
      81457423
Loading