summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* Tighen analyzer diagnostics w.r.t ObjC/CF leaks.Ted Kremenek2011-05-261-4/+5
| | | | llvm-svn: 132130
* Implement a new warning for when adding a default argument to a methodAlexis Hunt2011-05-262-2/+13
| | | | | | | | | makes it into a special member function. This is very bad and can lead to all sorts of nastiness including implicit member functions violating the One Definition Rule. This should probably be made ill-formed in a later version of the standard, but for now we'll just warn. llvm-svn: 132104
* Skip extra copy from aggregate where it isn't necessary; ↵Eli Friedman2011-05-261-0/+20
| | | | | | | | rdar://problem/8139919 . This shouldn't make much of a difference at -O3, but should substantially reduce the number of generated memcpy's at -O0. Originally r130717, but was backed out due to an ObjC regression. llvm-svn: 132102
* static analyzer: when conservatively evaluating functions, don't invalidate ↵Ted Kremenek2011-05-251-0/+38
| | | | | | the values of globals when the called function is strlen. llvm-svn: 132100
* Update our diagnostics to properly account for move operations.Alexis Hunt2011-05-252-3/+3
| | | | llvm-svn: 132096
* Add support for Microsoft __if_exists, __if_not_exists extension at class scope.Francois Pichet2011-05-251-1/+26
| | | | | | | | | | | | | | | | Example: typedef int TYPE; class C { __if_exists(TYPE) { TYPE a; } __if_not_exists(TYPE) { this will never be parsed. } }; llvm-svn: 132052
* Teach analyzer about cf_returns_not_retained for C functions.Ted Kremenek2011-05-251-0/+5
| | | | llvm-svn: 132049
* Enhance retain/release checker to flag warnings when functions returning CG ↵Ted Kremenek2011-05-252-4/+4
| | | | | | types do not follow the Core Foundation naming conventions. llvm-svn: 132048
* Implement a new type node, UnaryTransformType, designed to represent aAlexis Hunt2011-05-241-0/+10
| | | | | | | | type that turns one type into another. This is used as the basis to implement __underlying_type properly - with TypeSourceInfo and proper behavior in the face of templates. llvm-svn: 132017
* Fix Darwin test for r132006.Nick Lewycky2011-05-241-1/+1
| | | | llvm-svn: 132013
* Add explicit CFG support for ignoring static_asserts.Ted Kremenek2011-05-241-0/+11
| | | | llvm-svn: 132001
* Add new warning that warns when invoking 'delete' on a polymorphic, ↵Argyrios Kyrtzidis2011-05-241-1/+174
| | | | | | | | non-final, class without a virtual destructor. Patch by Matthieu Monrocq! llvm-svn: 131989
* Implement the initial part of C++0x [expr.const]p2, which specifiesDouglas Gregor2011-05-241-0/+25
| | | | | | | | | | | | that the unevaluated subexpressions of &&, ||, and ? : are not considered when determining whether the expression is a constant expression. Also, turn the "used in its own initializer" warning into a runtime-behavior warning, so that it doesn't fire when a variable is used as part of an unevaluated subexpression of its own initializer. Fixes PR9999. llvm-svn: 131968
* Fix a bug in -Wundefined-reinterpret-cast where we failed to lookChandler Carruth2011-05-241-0/+8
| | | | | | | | | | through sugared types when testing for TagTypes. This was the actual cause of the only false positive in Clang+LLVM. Next evaluation will be over a much larger selection of code including large amounts of open source code. llvm-svn: 131957
* MSVC doesn't do any validation regarding exception specification.Francois Pichet2011-05-241-0/+11
| | | | llvm-svn: 131950
* Test case for r131940.Devang Patel2011-05-241-0/+54
| | | | llvm-svn: 131941
* Delete the extraneous return statement that was causing my earlierAlexis Hunt2011-05-231-0/+19
| | | | | | | | | | issues and also add a test. We should now handle defaulted members of templates properly. No comment as to whether or not this also holds for templated functions, but defaulting those is kind of insane. llvm-svn: 131938
* Correctly propagate defaultedness across template instantiation. ThisAlexis Hunt2011-05-231-0/+12
| | | | | | | | fixes PR9965, but we're not out of the water yet, as we do not successfully handle out-of-line definitions, due to my utter misunderstanding of how we manage templates. llvm-svn: 131920
* Emulate a MSVC bug where if during an using declaration name lookup, the ↵Francois Pichet2011-05-231-0/+19
| | | | | | | | | | | | | | | declaration found is unaccessible (private) and that declaration was bring into scope via another using declaration whose target declaration is accessible (public) then no error is generated. Example: class A { public: int f(); }; class B : public A { private: using A::f; }; class C : public B { private: using B::f; }; Here, B::f is private so this should fail in Standard C++, but because B::f refers to A::f which is public MSVC accepts it. This fixes 1 error when parsing MFC code with clang. llvm-svn: 131896
* attempt to fix windows testers, which generate #line by default.Chris Lattner2011-05-221-1/+1
| | | | llvm-svn: 131882
* make the x86-32 backend specify a byval alignment, even when theChris Lattner2011-05-225-10/+10
| | | | | | | code generator will do it. With this patch, clang compiles the example in PR9794 to not have an alloca temporary. llvm-svn: 131881
* Fix x86-64 byval passing to specify the alignment even when the codeChris Lattner2011-05-221-1/+1
| | | | | | | generator will give it something sufficient. This is important because the mid-level optimizer doesn't know what alignment is required otherwise. llvm-svn: 131879
* Invoke the FileChanged callback before pushing the linemarker for a systemChris Lattner2011-05-221-0/+9
| | | | | | | | | | | | | | | | | | | | | | header. Getting it in the wrong order generated incorrect line markers in -E mode. In the testcase from PR9861 we used to generate: # 1 "test.c" 2 # 1 "./foobar.h" 1 # 0 "./foobar.h" # 0 "./foobar.h" 3 # 2 "test.c" 2 now we properly produce: # 1 "test.c" 2 # 1 "./foobar.h" 1 # 1 "./foobar.h" 3 # 2 "test.c" 2 This fixes PR9861. llvm-svn: 131871
* Fix fallout from r131838.Nick Lewycky2011-05-221-5/+5
| | | | llvm-svn: 131844
* Audit and finish the implementation of C++0x nullptr, fixing twoDouglas Gregor2011-05-212-1/+58
| | | | | | | | | | | | | | minor issues along the way: - Non-type template parameters of type 'std::nullptr_t' were not permitted. - We didn't properly introduce built-in operators for nullptr ==, !=, <, <=, >=, or > as candidate functions . To my knowledge, there's only one (minor but annoying) part of nullptr that hasn't been implemented: catching a thrown 'nullptr' as a pointer or pointer-to-member, per C++0x [except.handle]p4. llvm-svn: 131813
* It's considered poor form to create references to the overloadedDouglas Gregor2011-05-212-6/+36
| | | | | | | function type. Educate template argument deduction thusly, fixing PR9974 / <rdar://problem/9479155>. llvm-svn: 131811
* Classify bound member function types are member function types. FixesDouglas Gregor2011-05-211-0/+25
| | | | | | PR9973 / <rdar://problem/9479191>. llvm-svn: 131810
* Fix our handling of the warning when one tries to pass aDouglas Gregor2011-05-212-3/+22
| | | | | | | | | | | | non-POD/non-trivial object throuugh a C-style varargs. The warning itself was default-mapped to error, but can be downgraded, but we were treating it in Sema like a hard error, silently dropping the call. Instead, treat this problem like a warning, and do what the warning says we do: abort at runtime. To do so, we fake up a __builtin_trap() expression that gets evaluated as part of the argument. llvm-svn: 131805
* Diagnose the presence of storage-class-specifiers on explicitDouglas Gregor2011-05-211-0/+32
| | | | | | instantiations and specializations. Fixes <rdar://problem/9126453> and PR8700. llvm-svn: 131802
* Teach Sema::ActOnUninitializedDecl() not to try to interpret when oneDouglas Gregor2011-05-212-0/+15
| | | | | | | | should use a constructor to default-initialize a variable. InitializationSequence knows the rules for default initialization, better. Fixes <rdar://problem/8501008>. llvm-svn: 131796
* Introduce the -fdiagnostics-format=xxx option to control how ClangDouglas Gregor2011-05-211-0/+34
| | | | | | | | | | | | prints the file, line, and column of a diagnostic. We currently support Clang's normal format, MSVC, and Vi formats. Note that we no longer change the diagnostic format based on -fms-extensions. Patch by Andrew Fish! llvm-svn: 131794
* Implement C++0x semantics for passing non-POD classes through varargs.Douglas Gregor2011-05-211-0/+17
| | | | llvm-svn: 131792
* Only ignore extra tokens after #else if we skip it, otherwise warn. Fixes ↵Argyrios Kyrtzidis2011-05-211-0/+4
| | | | | | rdar://9475098. llvm-svn: 131788
* Fix regression in static analyzer's handling of prefix '--' operator. It ↵Ted Kremenek2011-05-201-0/+24
| | | | | | was being treated as postfix '--' in C mode. llvm-svn: 131770
* Add a missing case for default constructor deletion.Alexis Hunt2011-05-201-5/+4
| | | | | | | This case is tested by the fact that the modified test produces significatly worse diagnostics. That's on the list. llvm-svn: 131759
* Introduce XFAILed test for braced initializer lists.Sebastian Redl2011-05-201-0/+127
| | | | llvm-svn: 131754
* Introduce Type::isSignedIntegerOrEnumerationType() andDouglas Gregor2011-05-201-0/+9
| | | | | | | | | | | | | Type::isUnsignedIntegerOrEnumerationType(), which are like Type::isSignedIntegerType() and Type::isUnsignedIntegerType() but also consider the underlying type of a C++0x scoped enumeration type. Audited all callers to the existing functions, switching those that need to also handle scoped enumeration types (e.g., those that deal with constant values) over to the new functions. Fixes PR9923 / <rdar://problem/9447851>. llvm-svn: 131735
* Downgrade the error about re-opening an inline namespace as non-inlineDouglas Gregor2011-05-201-1/+1
| | | | | | | to a warning, since apparently libstdc++'s debug mode does this (and we can recover safely). Add a Fix-It to insert the "inline", just for kicks. llvm-svn: 131732
* Diagnose unexpanded parameter packs in return statements. ThisDouglas Gregor2011-05-201-0/+7
| | | | | | | manifested in a crash with blocks in PR9953, but it was a ticking time bomb for normal functions, too. Fixes PR9953. llvm-svn: 131731
* Remove the clang-test-XXX targets from the CMake builds; they really aren't ↵Douglas Gregor2011-05-201-24/+0
| | | | | | useful llvm-svn: 131728
* Fix PR9941 for out-of-line template destructors too.Sebastian Redl2011-05-201-0/+6
| | | | llvm-svn: 131722
* Undo enough of r131143 to make private copy ctor diags say "copy ↵Matt Beaumont-Gay2011-05-191-2/+2
| | | | | | constructor" again llvm-svn: 131706
* Teach RegionStore not to symbolic array values whose indices it cannot ↵Ted Kremenek2011-05-191-0/+19
| | | | | | reason about. llvm-svn: 131702
* Fix location of setter/getter synthesized for a property.Devang Patel2011-05-191-0/+19
| | | | llvm-svn: 131701
* Revert r131672 until __underlying_type is properly implemented in theAlexis Hunt2011-05-191-4/+0
| | | | | | template case. llvm-svn: 131692
* Fix test on Windows.Eli Friedman2011-05-191-1/+1
| | | | llvm-svn: 131691
* Implement a __has_feature for __underlying_typeAlexis Hunt2011-05-191-0/+4
| | | | llvm-svn: 131672
* Add a test for __underlying_typeAlexis Hunt2011-05-191-0/+27
| | | | llvm-svn: 131670
* Fix PR9941 again, this time for templates.Sebastian Redl2011-05-191-0/+29
| | | | llvm-svn: 131640
* Reapply r121528, fixing PR9941 by delaying the exception specification check ↵Sebastian Redl2011-05-194-13/+148
| | | | | | for destructors until the class is complete and destructors have been adjusted. llvm-svn: 131632
OpenPOWER on IntegriCloud