Skip to content
  1. Mar 12, 2012
    • Richard Smith's avatar
      Fix parsing of type-specifier-seq's. Types are syntactically allowed to be · c5b05520
      Richard Smith authored
      defined here, but not semantically, so
      
        new struct S {};
      
      is always ill-formed, even if there is a struct S in scope.
      
      We also had a couple of bugs in ParseOptionalTypeSpecifier caused by it being
      under-loved (due to it only being used in a few places) so merge it into
      ParseDeclarationSpecifiers with a new DeclSpecContext. To avoid regressing, this
      required improving ParseDeclarationSpecifiers' diagnostics in some cases. This
      also required teaching ParseSpecifierQualifierList about constexpr... which
      incidentally fixes an issue where we'd allow the constexpr specifier in other
      bad places.
      
      llvm-svn: 152549
      c5b05520
  2. Mar 07, 2012
  3. Mar 02, 2012
  4. Feb 29, 2012
  5. Feb 16, 2012
  6. Feb 15, 2012
  7. Feb 14, 2012
  8. Feb 12, 2012
    • Sebastian Redl's avatar
      Represent C++ direct initializers as ParenListExprs before semantic analysis · a935179a
      Sebastian Redl authored
      instead of having a special-purpose function.
      
      - ActOnCXXDirectInitializer, which was mostly duplication of
        AddInitializerToDecl (leading e.g. to PR10620, which Eli fixed a few days
        ago), is dropped completely.
      - MultiInitializer, which was an ugly hack I added, is dropped again.
      - We now have the infrastructure in place to distinguish between
        int x = {1};
        int x({1});
        int x{1};
      -- VarDecl now has getInitStyle(), which indicates which of the above was used.
      -- CXXConstructExpr now has a flag to indicate that it represents list-
         initialization, although this is not yet used.
      - InstantiateInitializer was renamed to SubstInitializer and simplified.
      - ActOnParenOrParenListExpr has been replaced by ActOnParenListExpr, which
        always produces a ParenListExpr. Placed that so far failed to convert that
        back to a ParenExpr containing comma operators have been fixed. I'm pretty
        sure I could have made a crashing test case before this.
      
      The end result is a (I hope) considerably cleaner design of initializers.
      More importantly, the fact that I can now distinguish between the various
      initialization kinds means that I can get the tricky generalized initializer
      test cases Johannes Schaub supplied to work. (This is not yet done.)
      
      This commit passed self-host, with the resulting compiler passing the tests. I
      hope it doesn't break more complicated code. It's a pretty big change, but one
      that I feel is necessary.
      
      llvm-svn: 150318
      a935179a
  9. Feb 10, 2012
  10. Feb 06, 2012
  11. Jan 28, 2012
  12. Jan 25, 2012
  13. Jan 24, 2012
    • Douglas Gregor's avatar
      Promote the extension warning for attempts to catch a reference or · 3ecbc3d6
      Douglas Gregor authored
      pointer to incomplete type from an ExtWarn to an error. We put the
      ExtWarn in place as part of a workaround for Boost (PR6527), but it
      (1) doesn't actually match a GCC extension and (2) has been fixed for
      two years in Boost, and (3) causes us to emit code that fails badly at
      run time, so it's a bad idea to keep it. Fixes PR11803.
      
      llvm-svn: 148838
      3ecbc3d6
  14. Jan 15, 2012
  15. Jan 05, 2012
    • Richard Smith's avatar
      PR10828: Produce a warning when a no-arguments function is declared in block · 69f90dce
      Richard Smith authored
      scope, when no other indication is provided that the user intended to declare a
      function rather than a variable.
      
      Remove some false positives from the existing 'parentheses disambiguated as a
      function' warning by suppressing it when the declaration is marked as 'typedef'
      or 'extern'.
      
      Add a new warning group -Wvexing-parse containing both of these warnings.
      
      The new warning is enabled by default; despite a number of false positives (and
      one bug) in clang's test-suite, I have only found genuine bugs with it when
      running it over a significant quantity of real C++ code.
      
      llvm-svn: 147599
      69f90dce
  16. Dec 29, 2011
  17. Dec 23, 2011
  18. Dec 21, 2011
  19. Dec 15, 2011
    • Richard Trieu's avatar
      Modify how the -verify flag works. Currently, the verification string and · 553b2b2e
      Richard Trieu authored
      diagnostic message are compared.  If either is a substring of the other, then
      no error is given.  This gives rise to an unexpected case:
      
        // expect-error{{candidate function has different number of parameters}}
      
      will match the following error messages from Clang:
      
        candidate function has different number of parameters (expected 1 but has 2)
        candidate function has different number of parameters
      
      It will also match these other error messages:
      
        candidate function
        function has different number of parameters
        number of parameters
      
      This patch will change so that the verification string must be a substring of
      the diagnostic message before accepting.  Also, all the failing tests from this
      change have been corrected.  Some stats from this cleanup:
      
      87 - removed extra spaces around verification strings
      70 - wording updates to diagnostics
      40 - extra leading or trailing characters (typos, unmatched parens or quotes)
      35 - diagnostic level was included (error:, warning:, or note:)
      18 - flag name put in the warning (-Wprotocol)
      
      llvm-svn: 146619
      553b2b2e
  20. Dec 13, 2011
  21. Dec 09, 2011
  22. Dec 05, 2011
  23. Dec 03, 2011
    • Francois Pichet's avatar
      In Microsoft mode, don't perform typo correction in a template member function... · 9c39113f
      Francois Pichet authored
      In Microsoft mode, don't perform typo correction in a template member function dependent context because it interferes with the "lookup into dependent bases of class templates" feature.
      
      Basically typo correction will try to offer a correction instead of looking into type dependent base classes.
      
      I found this problem while parsing Microsoft ATL code with clang.
      
      llvm-svn: 145772
      9c39113f
  24. Nov 25, 2011
    • Francois Pichet's avatar
      In Microsoft mode, make "Unqualified lookup into dependent bases of class... · de232cb1
      Francois Pichet authored
      In Microsoft mode, make "Unqualified lookup into dependent bases of class templates" works  inside a friend function definition at class scope.
      
      Basically we have to look into the parent *lexical* DeclContext for friend functions at class scope. That's because calling GetParent() return the namespace or file DeclContext.
      
      This fixes all remaining cases of "Unqualified lookup into dependent bases of class templates" when parsing MFC code with clang.
      
      llvm-svn: 145127
      de232cb1
  25. Nov 21, 2011
    • Richard Smith's avatar
      Add driver arguments -ftemplate-depth=N and -fconstexpr-depth=N, with the same · 9a56882e
      Richard Smith authored
      semantics and defaults as the corresponding g++ arguments. The historical g++
      argument -ftemplate-depth-N is kept for compatibility, but modern g++ versions
      no longer document that option.
      
      Add -cc1 argument -fconstexpr-depth N to implement the corresponding
      functionality.
      
      The -ftemplate-depth=N part of this fixes PR9890.
      
      llvm-svn: 145045
      9a56882e
  26. Nov 17, 2011
    • Francois Pichet's avatar
      In Microsoft mode, make "Unqualified lookup into dependent bases of class... · 857f9d6e
      Francois Pichet authored
      In Microsoft mode, make "Unqualified lookup into dependent bases of class templates" works  inside default argument instantiation.
      
      This is a little bit tricky because during default argument instantiation the CurContext points to a CXXMethodDecl but we can't use the keyword this or have an implicit member call generated.
      
      This fixes 2 errors when parsing MFC code with clang.
      
      llvm-svn: 144881
      857f9d6e
  27. Nov 16, 2011
  28. Nov 15, 2011
  29. Nov 11, 2011
  30. Nov 08, 2011
  31. Nov 07, 2011
    • Douglas Gregor's avatar
      Drastically simplify the mapping from the declaration corresponding to · 4109afa1
      Douglas Gregor authored
      the injected-class-name of a class (or class template) to the
      declaration that results from substituting the given template
      arguments. Previously, we would actually perform a substitution into
      the injected-class-name type and then retrieve the resulting
      declaration. However, in certain, rare circumstances involving
      deeply-nested member templates, we would get the wrong substitution
      arguments.
      
      This new approach just matches up the declaration with a declaration
      that's part of the current context (or one of its parents), which will
      either be an instantiation (during template instantiation) or the
      declaration itself (during the definition of the template). This is
      both more efficient (we're avoiding a substitution) and more correct
      (we can't get the template arguments wrong in the member-template
      case). 
      
      Fixes <rdar://problem/9676205>.
      
      Reinstated, now that we have the fix in r143967.
      
      llvm-svn: 143968
      4109afa1
    • Douglas Gregor's avatar
      Tighten up the conditions under which we consider ourselves to be · df593fbe
      Douglas Gregor authored
      entering the context of a nested-name-specifier. Fixes
      <rdar://problem/10397846>.
      
      llvm-svn: 143967
      df593fbe
  32. Nov 04, 2011
  33. Nov 02, 2011
    • Douglas Gregor's avatar
      Drastically simplify the mapping from the declaration corresponding to · 8f5653a9
      Douglas Gregor authored
      the injected-class-name of a class (or class template) to the
      declaration that results from substituting the given template
      arguments. Previously, we would actually perform a substitution into
      the injected-class-name type and then retrieve the resulting
      declaration. However, in certain, rare circumstances involving
      deeply-nested member templates, we would get the wrong substitution
      arguments.
      
      This new approach just matches up the declaration with a declaration
      that's part of the current context (or one of its parents), which will
      either be an instantiation (during template instantiation) or the
      declaration itself (during the definition of the template). This is
      both more efficient (we're avoiding a substitution) and more correct
      (we can't get the template arguments wrong in the member-template
      case). 
      
      Fixes <rdar://problem/9676205>.
      
      llvm-svn: 143551
      8f5653a9
  34. Nov 01, 2011
Loading