Skip to content
  1. Apr 27, 2011
  2. Apr 24, 2011
    • Sebastian Redl's avatar
      Make the invalid declarator recovery when parsing members work the same as... · 83f3b859
      Sebastian Redl authored
      Make the invalid declarator recovery when parsing members work the same as when parsing global decls. It's still rather broken (skipping much too far when the declarator belongs to a function definition), but at least not so broken as to mismatch braces. Tested by the removal of the fixme in the template test case.
      
      llvm-svn: 130101
      83f3b859
  3. Apr 15, 2011
    • Douglas Gregor's avatar
      Implement appropriate semantics for C++ casting and conversion when · b472e93a
      Douglas Gregor authored
      dealing with address-space- and GC-qualified pointers. Previously,
      these qualifiers were being treated just like cvr-qualifiers (in some
      cases) or were completely ignored, leading to uneven behavior. For
      example, const_cast would allow conversion between pointers to
      different address spaces.
      
      The new semantics are fairly simple: reinterpret_cast can be used to
      explicitly cast between pointers to different address spaces
      (including adding/removing addresss spaces), while
      static_cast/dynamic_cast/const_cast do not tolerate any changes in the
      address space. C-style casts can add/remove/change address spaces
      through the reinterpret_cast mechanism. Other non-CVR qualifiers
      (e.g., Objective-C GC qualifiers) work similarly.
      
      As part of this change, I tweaked the "casts away constness"
      diagnostic to use the term "casts away qualifiers". The term
      "constness" actually comes from the C++ standard, despite the fact
      that removing "volatile" also falls under that category. In Clang, we
      also have restrict, address spaces, ObjC GC attributes, etc., so the
      more general "qualifiers" is clearer.
      
      llvm-svn: 129583
      b472e93a
  4. Apr 14, 2011
    • Richard Smith's avatar
      Detect when the string "<::" is found in code after a cast or template name... · 55858499
      Richard Smith authored
      Detect when the string "<::" is found in code after a cast or template name and is interpreted as "[:" because of the digraph "<:". When found, give an error with a fix-it to add whitespace between the "<" and "::".
      
      Patch by Richard Trieu! Plus a small tweak from me to deal with one of the tokens coming from a macro.
      
      llvm-svn: 129540
      55858499
  5. Apr 10, 2011
  6. Apr 07, 2011
    • John McCall's avatar
      Basic, untested implementation for an "unknown any" type requested by LLDB. · 31996343
      John McCall authored
      The idea is that you can create a VarDecl with an unknown type, or a
      FunctionDecl with an unknown return type, and it will still be valid to
      access that object as long as you explicitly cast it at every use.  I'm
      still going back and forth about how I want to test this effectively, but
      I wanted to go ahead and provide a skeletal implementation for the LLDB
      folks' benefit and because it also improves some diagnostic goodness for
      placeholder expressions.
      
      llvm-svn: 129065
      31996343
  7. Mar 16, 2011
  8. Mar 12, 2011
  9. Mar 07, 2011
  10. Mar 06, 2011
  11. Mar 05, 2011
    • Douglas Gregor's avatar
      When substituting in for a template name, do not produce a qualified · 9d9f8db4
      Douglas Gregor authored
      template name as the result of substitution. The qualifier is handled
      separately by the tree transformer, so we would end up in an
      inconsistent state.
      
      This is actually the last bit of PR9016, and possibly also fixes
      PR8965. It takes Boost.Icl from "epic fail" down to a single failure.
      
      llvm-svn: 127108
      9d9f8db4
    • Douglas Gregor's avatar
      When determining template instantiation arguments within a function · 43669f84
      Douglas Gregor authored
      template (not a specialization!), use the "injected" function template
      arguments, which correspond to the template parameters of the function
      template. This is required when substituting into the default template
      parameters of template template parameters within a function template.
      
      Fixes PR9016.
      
      llvm-svn: 127092
      43669f84
    • Douglas Gregor's avatar
      When transforming a substituted template type parameter, try to · 20bf98b5
      Douglas Gregor authored
      transform the type that replaces the template type parameter. In the
      vast majority of cases, there's nothing to do, because most template
      type parameters are replaced with something non-dependent that doesn't
      need further transformation. However, when we're dealing with the
      default template arguments of template template parameters, we might
      end up replacing a template parameter (of the template template
      parameter) with a template parameter of the enclosing template. 
       
      This addresses part of PR9016, but not within function
      templates. That's a separate issue.
      
      llvm-svn: 127091
      20bf98b5
  12. Mar 04, 2011
    • Douglas Gregor's avatar
      Diagnose destructor templates. Fixes PR7904. · 93ded320
      Douglas Gregor authored
      llvm-svn: 127042
      93ded320
    • Douglas Gregor's avatar
      Teach Sema::ActOnCXXNestedNameSpecifier and Sema::CheckTemplateIdType · 8b6070bb
      Douglas Gregor authored
      to cope with non-type templates by providing appropriate
      errors. Previously, we would either assert, crash, or silently build a
      dependent type when we shouldn't. Fixes PR9226.
      
      llvm-svn: 127037
      8b6070bb
    • Douglas Gregor's avatar
      When constructing source-location information for a · 23648d7e
      Douglas Gregor authored
      DependentTemplateSpecializationType during tree transformation, retain
      the NestedNameSpecifierLoc as it was used to translate the template
      name, rather than reconstructing it from the template name.
      
      Fixes PR9401.
      
      llvm-svn: 127015
      23648d7e
    • Douglas Gregor's avatar
      Make sure to put template parameters into their owning template's · fd7c2255
      Douglas Gregor authored
      DeclContext once we've created it. This mirrors what we do for
      function parameters, where the parameters start out with
      translation-unit context and then are adopted by the appropriate
      DeclContext when it is created. Also give template parameters public
      access and make sure that they don't show up for the purposes of name
      lookup.
      
      Fixes PR9400, a regression introduced by r126920, which implemented
      substitution of default template arguments provided in template
      template parameters (C++ core issue 150).
      
      How on earth could the DeclContext of a template parameter affect the
      handling of default template arguments?
      
      I'm so glad you asked! The link is
      Sema::getTemplateInstantiationArgs(), which determines the outer
      template argument lists that correspond to a given declaration. When
      we're instantiating a default template argument for a template
      template parameter within the body of a template definition (not it's
      instantiation, per core issue 150), we weren't getting any outer
      template arguments because the context of the template template
      parameter was the translation unit. Now that the context of the
      template template parameter is its owning template, we get the
      template arguments from the injected-class-name of the owning
      template, so substitution works as it should.
      
      llvm-svn: 127004
      fd7c2255
  13. Mar 03, 2011
    • Douglas Gregor's avatar
      When we use the default template arguments of a template template · 739b107a
      Douglas Gregor authored
      parameter, save the instantiated default template arguments along with
      the explicitly-specified template argument list. That way, we prefer
      the default template template arguments corresponding to the template
      template parameter rather than those of its template template argument.
      
      This addresses the likely direction of C++ core issue 150, and fixes
      PR9353/<rdar://problem/9069136>, bringing us closer to the behavior of
      EDG and GCC.
      
      llvm-svn: 126920
      739b107a
  14. Mar 02, 2011
    • Douglas Gregor's avatar
      Push nested-name-specifier source-location information into dependent · e7c20653
      Douglas Gregor authored
      template specialization types. This also required some parser tweaks,
      since we were losing track of the nested-name-specifier's source
      location information in several places in the parser. Other notable
      changes this required:
      
        - Sema::ActOnTagTemplateIdType now type-checks and forms the
          appropriate type nodes (+ source-location information) for an
          elaborated-type-specifier ending in a template-id. Previously, we
          used a combination of ActOnTemplateIdType and
          ActOnTagTemplateIdType that resulted in an ElaboratedType wrapped
          around a DependentTemplateSpecializationType, which duplicated the
          keyword ("class", "struct", etc.) and nested-name-specifier
          storage.
      
        - Sema::ActOnTemplateIdType now gets a nested-name-specifier, which
          it places into the returned type-source location information.
      
        - Sema::ActOnDependentTag now creates types with source-location
          information.
      
      llvm-svn: 126808
      e7c20653
  15. Mar 01, 2011
  16. Feb 28, 2011
  17. Feb 19, 2011
  18. Feb 18, 2011
  19. Feb 17, 2011
    • Douglas Gregor's avatar
      When printing a qualified type, look through a substituted template · b0f2ea9e
      Douglas Gregor authored
      parameter type to see what's behind it, so that we don't end up
      printing silly things like "float const *" when "const float *" would
      make more sense. Also, replace the pile of "isa" tests with a simple
      switch enumerating all of the cases, making a few more obvious cases
      use prefix qualifiers.
      
      llvm-svn: 125729
      b0f2ea9e
  20. Feb 14, 2011
  21. Feb 04, 2011
  22. Jan 25, 2011
  23. Jan 24, 2011
  24. Jan 07, 2011
  25. Jan 04, 2011
  26. Dec 22, 2010
  27. Dec 21, 2010
Loading