summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX
Commit message (Collapse)AuthorAgeFilesLines
* Don't warn for empty 'if' body if there is a macro that expands to nothing, e.g:Argyrios Kyrtzidis2010-11-191-0/+35
| | | | | | | | | if (condition) CALL(0); // empty macro but don't warn for empty body. Fixes rdar://8436021. llvm-svn: 119838
* objc_msgSend is not a builtin type in non-objc mode.Fariborz Jahanian2010-11-191-0/+14
| | | | | | Fixes //rdar://8686888 llvm-svn: 119813
* comparison of AltiVec vectors now gives bool result (fix for 7533)Anton Yartsev2010-11-181-1/+1
| | | | llvm-svn: 119678
* -Rename -Wargument-larger-than -> -Wlarge-by-value-copyArgyrios Kyrtzidis2010-11-181-4/+4
| | | | | | | | | -Improve the diagnostic message -Add some comments Suggestions by Chris. llvm-svn: 119594
* Introduce option -Wargument-larger-than[=N] which warns about function ↵Argyrios Kyrtzidis2010-11-171-0/+42
| | | | | | | | | | definitions if they take by-value or return by-value any POD that is larger than some threshold (default is 64 bytes). Implements rdar://8548050. llvm-svn: 119583
* Fix PR8625 and correctly interpret member-calls to static members whenChandler Carruth2010-11-161-1/+13
| | | | | | | | | | | | producing warnings. This feels really fragile, and I've not audited all other argument index-based warnings. I suspect we'll grow this bug on another warning eventually. It might be nice to adjust the argument indices when building up the attribute AST node, as we already have to remember about the 'this' argument within that code to produce correct errors. llvm-svn: 119340
* Re-work the handling of implicit 'this' arguments and silly GCC-style attributeChandler Carruth2010-11-163-8/+33
| | | | | | | | | | | | | | | | argument indexes. This handles the offsets in a consistent manner for all of the attributes which I saw working with these concepts. I've also added tests for the attribute that motivated this: nonnull. I consolidated the tests for format attributes into one file, and fleshed them out a bit to trigger more of the warning cases. Also improved the quality of some of the diagnostics that occur with invalid argument indices. The only really questionable change here is supporting the implicit this argument for the ownership attribute. I'm not sure it's really a sensible concept there, but implemented the logic for consistency. llvm-svn: 119339
* Improve diagnostic for calling non-const method on const object. Fixes ↵Argyrios Kyrtzidis2010-11-161-2/+2
| | | | | | rdar://7743000 llvm-svn: 119336
* Add another case to the whitelist of cast kinds that can convert to bool.John McCall2010-11-161-0/+4
| | | | | | Fixes PR8608. llvm-svn: 119293
* When complaining about ambiguous overload resolution for a unary orDouglas Gregor2010-11-131-2/+2
| | | | | | binary operator, provide the types. llvm-svn: 119008
* When performing initialization of a copy of a temporary object, useDouglas Gregor2010-11-121-2/+2
| | | | | | | direct-initialization (rather than copy-initialization) to initialize the temporary, allowing explicit constructors. Fixes PR8342. llvm-svn: 118880
* Extend the bitfield-truncation warning to initializations.John McCall2010-11-111-0/+7
| | | | | | rdar://problem/8652606 llvm-svn: 118773
* Friend function declarations can overload with tag declarations.John McCall2010-11-101-0/+8
| | | | | | Fixes PR7915. llvm-svn: 118670
* Diagnose attempst to template using declarations and using directives.John McCall2010-11-102-0/+20
| | | | | | Recover from the latter and fail early for the former. Fixes PR8022. llvm-svn: 118669
* Attempt to resolve overloaded functions in comma expressions andDouglas Gregor2010-11-091-0/+14
| | | | | | conditional operators. Fixes PR7863. llvm-svn: 118631
* Revert the fix for PR8013.Douglas Gregor2010-11-091-8/+0
| | | | | | | | | | | | | That bug concerned the well-formedness of code such as (&ovl)(a, b, c). GCC rejects the code, while EDG accepts it. On further study of the standard, I see no support for EDG's position: in particular, C++ [over.over] does not list this as a context where we can take the address of an overloaded function, C++ [over.call.func] does not reference the address-of operator at any point, and C++ [expr.call] claims that the function argument in a call is either a function lvalue or a pointer-to-function; (&ovl) is neither. llvm-svn: 118620
* Handle overload resolution when calling an overloaded function setDouglas Gregor2010-11-091-0/+8
| | | | | | with, e.g., (&f)(a, b, c). Fixes PR8013. llvm-svn: 118508
* Make #pragma unused work for static local variables.Douglas Gregor2010-11-091-0/+6
| | | | llvm-svn: 118500
* Add __nullptr as a C++0x nullptr literal, available in C++98Douglas Gregor2010-11-091-0/+3
| | | | llvm-svn: 118482
* When building a compound literal, check that the base element of the array ↵Argyrios Kyrtzidis2010-11-081-0/+14
| | | | | | | | is complete. Fixes rdar://8620582 & http://llvm.org/PR7905 llvm-svn: 118428
* When attempting reference binding to an overloaded function, alsoDouglas Gregor2010-11-081-0/+29
| | | | | | | consider that we might be trying to bind a reference to a class type, which involves a constructor call. Fixes PR7425. llvm-svn: 118407
* Add missing test case for PR8230Douglas Gregor2010-11-081-0/+57
| | | | llvm-svn: 118402
* Properly diagnose invalid casts to function references. Patch byDouglas Gregor2010-11-082-8/+8
| | | | | | Faisal Vali, tweaked by me. Fixes PR8230. llvm-svn: 118400
* A union cannot contain static data members or data members of reference type.Anders Carlsson2010-11-071-1/+1
| | | | llvm-svn: 118381
* Don't warn when matching %p to nullptr.Anders Carlsson2010-11-061-0/+9
| | | | llvm-svn: 118344
* When determining which template partial specialization is more specialized,Argyrios Kyrtzidis2010-11-051-0/+27
| | | | | | make sure to setup the instantiation stack. Fixes rdar://8620775 & http://llvm.org/PR8234 llvm-svn: 118314
* Expressions of type std::nullptr_t can be used as sentinels.Anders Carlsson2010-11-051-0/+9
| | | | llvm-svn: 118276
* Implement [over.ics.rank]p4: A conversion that does not convert an ↵Anders Carlsson2010-11-051-2/+17
| | | | | | std::nullptr_t to bool is better than one than does. llvm-svn: 118269
* Don't be so eager to replace UsingDecls in a DeclContext's lookup table;Argyrios Kyrtzidis2010-11-041-0/+18
| | | | | | check that the TargetNestedNameDecl is the same first. llvm-svn: 118239
* It's OK to use nullptr in relational operators if the other side is a null ↵Anders Carlsson2010-11-041-0/+4
| | | | | | pointer constant. llvm-svn: 118234
* Make this error less specific but also less likely to cause confusion. FixesNick Lewycky2010-11-033-8/+14
| | | | | | PR7702. llvm-svn: 118181
* When producing overload candidates for binary built-in operators, keepDouglas Gregor2010-11-031-0/+20
| | | | | | | | | the sets of available conversions for the first and second arguments separate. This is apparently the indent of C++ [over.built], and reduces the number of overload candidates generated, eliminating some ambiguities. Fixes PR8477. llvm-svn: 118178
* Provide an error when a non-identifier name (such as an operator) is used as aAlexis Hunt2010-11-031-0/+3
| | | | | | | | parameter name. Fixes PR8012. llvm-svn: 118138
* Properly handle temporaries that are created in a AsmStmt.Argyrios Kyrtzidis2010-11-021-13/+0
| | | | | | Previously the temporaries would get destroyed before the asm call. llvm-svn: 118001
* Clean up temporaries created by an asm statement. Fixes rdar://8540491Argyrios Kyrtzidis2010-11-011-0/+13
| | | | llvm-svn: 117961
* Emit error when using a bound member function for something other than ↵Argyrios Kyrtzidis2010-11-011-0/+14
| | | | | | | | calling it. Also avoids IRGen crashes due to accepting invalid code. llvm-svn: 117943
* Emit an error when trying to form a pointer-to-member to a bitfield.Argyrios Kyrtzidis2010-10-301-0/+5
| | | | | | As a bonus, avoids a crash on the IRGen side due to accepting invalid code. llvm-svn: 117842
* renamed: test/SemaCXX/ptrtomember-badcall.cpp -> test/SemaCXX/ptrtomember.cppArgyrios Kyrtzidis2010-10-301-0/+0
| | | | llvm-svn: 117841
* Don't remove the init expression from the initializer list if it had a ↵Argyrios Kyrtzidis2010-10-301-0/+15
| | | | | | | | | semantic error. We already flag the error with InitListChecker's hadError and we mess up the AST unnecessarily. Fixes rdar://8605381. llvm-svn: 117760
* Add test/SemaCXX/crash-PR7625.cpp into test/SemaCXX/crashes.cppArgyrios Kyrtzidis2010-10-302-6/+7
| | | | llvm-svn: 117759
* test/SemaCXX/crash-8124080.cpp -> test/SemaCXX/crashes.cppArgyrios Kyrtzidis2010-10-301-0/+0
| | | | llvm-svn: 117758
* Add test case for <rdar://problem/8610363> (a bogus report of using an ↵Ted Kremenek2010-10-301-0/+14
| | | | | | | | uninitialized field). This was already fixed, but this serves for detecting regressions. llvm-svn: 117754
* When doing name lookup for members don't look into global/namespace scope.Argyrios Kyrtzidis2010-10-291-0/+13
| | | | | | Better performance and fixes rdar://8603569. llvm-svn: 117656
* Implement an indirect-goto optimization for goto *&&lbl and respect thisJohn McCall2010-10-281-2/+2
| | | | | | | | | | | | | | in the scope checker. With that done, turn an indirect goto into a protected scope into a hard error; otherwise IR generation has to start worrying about declarations not dominating their scopes, as exemplified in PR8473. If this really affects anyone, I can probably adjust this to only hard-error on possible indirect gotos into VLA scopes rather than arbitrary scopes. But we'll see how people cope with the aggressive change on the marginal feature. llvm-svn: 117539
* Parse attributes on enumerators and instantiate attributes on enum decls.John McCall2010-10-221-0/+43
| | | | llvm-svn: 117182
* Implement the integral promotion rules for the C++0x char16_t andDouglas Gregor2010-10-211-0/+11
| | | | | | | char32_t character types and enable built-in overloaded operator candidates for these types. Fixes PR8432. llvm-svn: 117038
* Microsoft enum extensions. 2 things will change on -fms-extensions:Francois Pichet2010-10-181-1/+10
| | | | | | | 1. enum underlying type is int by default. 2. Error "enumerator value is not representable in the underlying type"is a ExtWarning llvm-svn: 116704
* Report the location of the syntax error inside a macro. Fixes PR7944.Nick Lewycky2010-10-151-0/+12
| | | | llvm-svn: 116624
* Diagnose C++ [class.mem]p13-14, where a class member has the same nameDouglas Gregor2010-10-151-1/+2
| | | | | | as the class itself. Fixes PR7082. llvm-svn: 116573
* Don't complain about a variable within a linkage-specification that isDouglas Gregor2010-10-151-0/+3
| | | | | | initialized. Fixes PR7076. llvm-svn: 116553
OpenPOWER on IntegriCloud