Skip to content
  1. Sep 13, 2012
  2. Sep 06, 2012
  3. Aug 30, 2012
  4. Aug 18, 2012
    • Richard Smith's avatar
      PR41111, PR5925, PR13210: Teach tentative parsing to annotate identifiers and · 4f605aff
      Richard Smith authored
      nested names as id-expressions, using the annot_primary_expr annotation, where
      possible. This removes some redundant lookups, and also allows us to
      typo-correct within tentative parsing, and to carry on disambiguating past an
      identifier which we can determine will fail lookup as both a type and as a
      non-type, allowing us to disambiguate more declarations (and thus offer
      improved error recovery for such cases).
      
      This also introduces to the parser the notion of a tentatively-declared name,
      which is an identifier which we *might* have seen a declaration for in a
      tentative parse (but only if we end up disambiguating the tokens as a
      declaration). This is necessary to correctly disambiguate cases where a
      variable is used within its own initializer.
      
      llvm-svn: 162159
      4f605aff
  5. Aug 08, 2012
    • David Blaikie's avatar
      Implement warning for integral null pointer constants other than the literal 0. · 1c7c8f76
      David Blaikie authored
      This is effectively a warning for code that violates core issue 903 & thus will
      become standard error in the future, hopefully. It catches strange null
      pointers such as: '\0', 1 - 1, const int null = 0; etc...
      
      There's currently a flaw in this warning (& the warning for 'false' as a null
      pointer literal as well) where it doesn't trigger on comparisons (ptr == '\0'
      for example). Fix to come in a future patch.
      
      Also, due to this only being a warning, not an error, it triggers quite
      frequently on gtest code which tests expressions for null-pointer-ness in a
      SFINAE context (so it wouldn't be a problem if this was an error as in an
      actual implementation of core issue 903). To workaround this for now, the
      diagnostic does not fire in unevaluated contexts.
      
      Review by Sean Silva and Richard Smith.
      
      llvm-svn: 161501
      1c7c8f76
  6. Jul 30, 2012
    • Richard Smith's avatar
      Improvements to vexing-parse warnings. Make the no-parameters case more · 943c4404
      Richard Smith authored
      accurate by asking the parser whether there was an ambiguity rather than trying
      to reverse-engineer it from the DeclSpec. Make the with-parameters case have
      better diagnostics by using semantic information to drive the warning,
      improving the diagnostics and adding a fixit.
      
      Patch by Nikola Smiljanic. Some minor changes by me to suppress diagnostics for
      declarations of the form 'T (*x)(...)', which seem to have a very high false
      positive rate, and to reduce indentation in 'warnAboutAmbiguousFunction'.
      
      llvm-svn: 160998
      943c4404
  7. Jul 27, 2012
    • Richard Smith's avatar
      Final piece of core issue 1330: delay computing the exception specification of · d3b5c908
      Richard Smith authored
      a defaulted special member function until the exception specification is needed
      (using the same criteria used for the delayed instantiation of exception
      specifications for function temploids).
      
      EST_Delayed is now EST_Unevaluated (using 1330's terminology), and, like
      EST_Uninstantiated, carries a pointer to the FunctionDecl which will be used to
      resolve the exception specification.
      
      This is enabled for all C++ modes: it's a little faster in the case where the
      exception specification isn't used, allows our C++11-in-C++98 extensions to
      work, and is still correct for C++98, since in that mode the computation of the
      exception specification can't fail.
      
      The diagnostics here aren't great (in particular, we should include implicit
      evaluation of exception specifications for defaulted special members in the
      template instantiation backtraces), but they're not much worse than before.
      
      Our approach to the problem of cycles between in-class initializers and the
      exception specification for a defaulted default constructor is modified a
      little by this change -- we now reject any odr-use of a defaulted default
      constructor if that constructor uses an in-class initializer and the use is in
      an in-class initialzer which is declared lexically earlier. This is a closer
      approximation to the current draft solution in core issue 1351, but isn't an
      exact match (but the current draft wording isn't reasonable, so that's to be
      expected).
      
      llvm-svn: 160847
      d3b5c908
  8. Jul 16, 2012
  9. Jul 13, 2012
  10. Jul 09, 2012
    • Richard Smith's avatar
      PR13136: · 34349003
      Richard Smith authored
       * When substituting a reference to a non-type template parameter pack where the
         corresponding argument is a pack expansion, transform into an expression
         which contains an unexpanded parameter pack rather than into an expression
         which contains a pack expansion. This causes the SubstNonTypeTemplateParmExpr
         to be inside the PackExpansionExpr, rather than outside, so the expression
         still looks like a pack expansion and can be deduced.
      
       * Teach MarkUsedTemplateParameters that we can deduce a reference to a template
         parameter if it's wrapped in a SubstNonTypeTemplateParmExpr (such nodes are
         added during alias template substitution).
      
      llvm-svn: 159922
      34349003
  11. Jul 08, 2012
  12. Jul 07, 2012
    • Richard Smith's avatar
      When marking virtual functions as used for a class' vtable, mark all functions · 4ff9ff97
      Richard Smith authored
      which will appear in the vtable as used, not just those ones which were
      declared within the class itself. Fixes an issue reported as comment#3 in
      PR12763 -- we sometimes assert in codegen if we try to emit a reference to a
      function declaration which we've not marked as referenced. This also matches
      gcc's observed behavior.
      
      llvm-svn: 159895
      4ff9ff97
  13. Jun 25, 2012
  14. Jun 22, 2012
  15. Jun 20, 2012
  16. Jun 10, 2012
  17. Jun 08, 2012
  18. May 22, 2012
  19. May 20, 2012
  20. May 19, 2012
  21. May 15, 2012
  22. May 09, 2012
    • Richard Smith's avatar
      Recover properly if a class member declaration starts with a scope specifier · 45855df4
      Richard Smith authored
      or template-id which can't be parsed.
      
      llvm-svn: 156468
      45855df4
    • Richard Smith's avatar
      A little tweak to the SFINAE condition reporting. Don't say: · 6f8d2c6c
      Richard Smith authored
        candidate template ignored: substitution failed [with T = int]: no type named 'type' in 'std::enable_if<false, void>'
      
      Instead, just say:
      
        candidate template ignored: disabled by 'enable_if' [with T = int]
      
      ... and point at the enable_if condition which (we assume) failed.
      
      This is applied to all cases where the user writes 'typename enable_if<...>::type' (optionally prefixed with a nested name specifier), and 'enable_if<...>' names a complete class type which does not have a member named 'type', and this results in a candidate function being ignored in a SFINAE context. Thus it catches 'std::enable_if', 'std::__1::enable_if', 'boost::enable_if' and 'llvm::enable_if'.
      
      llvm-svn: 156463
      6f8d2c6c
  23. May 07, 2012
    • Richard Smith's avatar
      When we suppress an error due to SFINAE, stash the diagnostic away with the · 9ca6461f
      Richard Smith authored
      overload candidate, and include its message in any subsequent 'candidate not
      viable due to substitution failure' note we may produce.
      
      To keep the note small (since the 'overload resolution failed' diagnostics are
      often already very verbose), the text of the SFINAE diagnostic is included as
      part of the text of the note, and any notes which were attached to it are
      discarded.
      
      There happened to be spare space in OverloadCandidate into which a
      PartialDiagnosticAt could be squeezed, and this patch goes to lengths to avoid
      unnecessary PartialDiagnostic copies, resulting in no slowdown that I could
      measure. (Removal in passing of some PartialDiagnostic copies has resulted in a
      slightly smaller clang binary overall.) Even on a torture test, I was unable to
      measure a memory increase of above 0.2%.
      
      llvm-svn: 156297
      9ca6461f
  24. May 01, 2012
  25. Apr 27, 2012
  26. Apr 25, 2012
  27. Apr 22, 2012
  28. Apr 21, 2012
  29. Apr 20, 2012
  30. Apr 19, 2012
Loading