Skip to content
  1. Aug 23, 2011
    • Matt Beaumont-Gay's avatar
      Fix an incorrect note. · 56381b85
      Matt Beaumont-Gay authored
      For the test case added to function-redecl.cpp, we were previously complaining
      about a mismatch in the parameter types, since the definition used the
      typedef'd type.
      
      llvm-svn: 138318
      56381b85
  2. Aug 22, 2011
  3. Aug 19, 2011
  4. Aug 18, 2011
  5. Aug 17, 2011
    • John McCall's avatar
      Gather cleanups correctly in block return statements. · 75f92b51
      John McCall authored
      Thanks to Ted for finding this with magic tools.
      
      llvm-svn: 137877
      75f92b51
    • Argyrios Kyrtzidis's avatar
      Mark objc methods that are implicitly declared for properties (not user-declared) as implicit. · 004df6e0
      Argyrios Kyrtzidis authored
      This results in libclang ignoring such methods.
      
      llvm-svn: 137852
      004df6e0
    • Chandler Carruth's avatar
      Treating the unused equality comparisons as something other than part of · e2669397
      Chandler Carruth authored
      -Wunused was a mistake. It resulted in duplicate warnings and lots of
      other hacks. Instead, this should be a special sub-category to
      -Wunused-value, much like -Wunused-result is.
      
      Moved to -Wunused-comparison, moved the implementation to piggy back on
      the -Wunused-value implementation instead of rolling its own, different
      mechanism for catching all of the "interesting" statements.
      
      I like the unused-value mechanism for this better, but its currently
      missing several top-level statements. For now, I've FIXME-ed out those
      test cases. I'll enhance the generic infrastructure to catch these
      statements in a subsequent patch.
      
      This patch also removes the cast-to-void fixit hint. This hint isn't
      available on any of the other -Wunused-value diagnostics, and if we want
      it to be, we should add it generically rather than in one specific case.
      
      llvm-svn: 137822
      e2669397
    • Chandler Carruth's avatar
      Don't suggest assignment in implausible situation. We still warn, as the · e89ca5f7
      Chandler Carruth authored
      code is very likely to be buggy, but its going to require more
      significant changes on the part of the user to correct it in this case.
      
      llvm-svn: 137820
      e89ca5f7
    • Chandler Carruth's avatar
      Introduce a new warning, -Wtop-level-comparison. This warning is · ae51ecc5
      Chandler Carruth authored
      a complement to the warnings we provide in condition expressions. Much
      like we warn on conditions such as:
      
        int x, y;
        ...
        if (x = y) ... // Almost always a typo of '=='
      
      This warning applies the complementary logic to "top-level" statements,
      or statements whose value is not consumed or used in some way:
      
        int x, y;
        ...
        x == y; // Almost always a type for '='
      
      We also mirror the '!=' vs. '|=' logic.
      
      The warning is designed to fire even for overloaded operators for two reasons:
      
      1) Especially in the presence of widespread templates that assume
         operator== and operator!= perform the expected comparison operations,
         it seems unreasonable to suppress warnings on the offchance that
         a user has written a class that abuses these operators, embedding
         side-effects or other magic within them.
      2) There is a trivial source modification to silence the warning for
         truly exceptional cases:
      
           (void)(x == y); // No warning
      
      A (greatly reduced) form of this warning has already caught a number of
      bugs in our codebase, so there is precedent for it actually firing. That
      said, its currently off by default, but enabled under -Wall.
      
      There are several fixmes left here that I'm working on in follow-up
      patches, including de-duplicating warnings from -Wunused, sharing code
      with -Wunused's implementation (and creating a nice place to hook
      diagnostics on "top-level" statements), and handling cases where a proxy
      object with a bool conversion is returned, hiding the operation in the
      cleanup AST nodes.
      
      Suggestions for any of this code more than welcome. Also, I'd really
      love suggestions for better naming than "top-level".
      
      llvm-svn: 137819
      ae51ecc5
    • Chandler Carruth's avatar
      Switch this code to use the more idiomatic 'dyn_cast' pattern. · f87d6c00
      Chandler Carruth authored
      llvm-svn: 137780
      f87d6c00
  6. Aug 15, 2011
  7. Aug 14, 2011
    • Francois Pichet's avatar
      Implement function template specialization at class scope extension in... · 00c7e6ce
      Francois Pichet authored
      Implement function template specialization at class scope extension in Microsoft mode. A new AST node is introduced: ClassScopeFunctionSpecialization. This node holds a FunctionDecl that is not yet specialized; then during the class template instantiation the ClassScopeFunctionSpecialization will spawn the actual function specialization.
      
      Example:
      template <class T>
      class A {
      public:
        template <class U> void f(U p) {  }
        template <> void f(int p) {  } // <== class scope specialization
      };
      
      This extension is necessary to parse MSVC standard C++ headers, MFC and ATL code.
      BTW, with this feature in, clang can parse (-fsyntax-only) all the MSVC 2010 standard header files without any error.
      
      llvm-svn: 137573
      00c7e6ce
  8. Aug 12, 2011
Loading