summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX
Commit message (Collapse)AuthorAgeFilesLines
* -Wc++98-compat: warn on C++11 attributes and alignas.Richard Smith2011-10-141-1/+4
| | | | llvm-svn: 141999
* Test for r141985.Richard Smith2011-10-141-0/+10
| | | | llvm-svn: 141998
* Don't try to diagnose anything when we're passing incomplete typesDouglas Gregor2011-10-141-1/+0
| | | | | | | | through varargs. This only happens when we're in an unevaluated context, where we don't want to trigger an error anyway. Fixes PR11131 / <rdar://problem/10288375>. llvm-svn: 141986
* Only warn in -Wliteral-conversion if the conversion loses informationMatt Beaumont-Gay2011-10-141-10/+5
| | | | llvm-svn: 141955
* Revert the -Wc++98-compat flag because dgregor doesn't like it.Jeffrey Yasskin2011-10-141-10/+0
| | | | llvm-svn: 141921
* Fix a test case where FileCheck is used to test code corrected by -fixit.Richard Trieu2011-10-131-1/+1
| | | | | | | | If the code file is not run through the preproccessor to remove comments, then FileCheck will match the strings within the CHECK commands rendering the test useless. llvm-svn: 141911
* Convert newly-added test from -std=c++0x to -std=c++11.Richard Smith2011-10-131-1/+1
| | | | llvm-svn: 141904
* Extend -Wno-sizeof-array-argument to strncpy and friends.Nico Weber2011-10-131-0/+25
| | | | | | This finds 2 bugs in chromium and 1 in hunspell, with 0 false positives. llvm-svn: 141902
* Update all tests other than Driver/std.cpp to use -std=c++11 rather thanRichard Smith2011-10-1379-79/+79
| | | | | | -std=c++0x. Patch by Ahmed Charles! llvm-svn: 141900
* Implement the first piece of a -Wc++98-compat flag so that people can build inJeffrey Yasskin2011-10-131-0/+10
| | | | | | | | C++11 mode but keep their sources compatible with C++98. This patch implements the -Wc++98-compat-variadic-templates sub-flag and -Wc++98-compat to include it. llvm-svn: 141898
* Allow calling an overloaded function set by taking the address of theDouglas Gregor2011-10-132-1/+11
| | | | | | functions, e.g., (&f)(0). Fixes <rdar://problem/9803316>. llvm-svn: 141877
* Switch diagnostic text from "C++0x" over to "C++11".Douglas Gregor2011-10-129-21/+21
| | | | | | | | We'd also like for "C++11" or "c++11" to be used for the warning groups, but without removing the old warning flags. Patches welcome; I've run out of time to work on this today. llvm-svn: 141801
* Teach __has_nothrow_assign not to complain about access (GCC and EDGDouglas Gregor2011-10-121-0/+34
| | | | | | | ignore access entirely for it) and not to crash on assignment operator templates. Fixes PR11110. llvm-svn: 141777
* Catch placeholder types in DefaultLvalueConversionJohn McCall2011-10-118-50/+51
| | | | | | | | | | | and DefaultFunctionArrayLvalueConversion. To prevent significant regression for should-this-be-a-call fixits, and to repair some such regression from the introduction of bound member placeholders, make those placeholder checks try to build calls appropriately. Harden the build-a-call logic while we're at it. llvm-svn: 141738
* Add a -Wc++0x-compat warning for C++11 keywords used as identifiers when inRichard Smith2011-10-111-1/+1
| | | | | | C++98 mode. Only the first occurrence of each keyword will produce a warning. llvm-svn: 141700
* Add more testing for -Wc++0x-compat warnings.Richard Smith2011-10-111-0/+24
| | | | llvm-svn: 141685
* Add an explanatory comment to test/SemaCXX/typo-correction.cppKaelyn Uhrain2011-10-111-2/+8
| | | | llvm-svn: 141680
* [Microsoft] If -fms-compatibility, then downgrade missing typename error to ↵Francois Pichet2011-10-111-2/+2
| | | | | | warning at function prototype scope. llvm-svn: 141630
* Add typo correction for type names.Kaelyn Uhrain2011-10-112-4/+33
| | | | | | | | The main motivation was to do typo correction in C++ "new" statements, though picking it up in other places where type names are expected was pretty much a freebie. llvm-svn: 141621
* Only accept a typo correction if it doesn't trigger additional errorsKaelyn Uhrain2011-10-111-1/+4
| | | | llvm-svn: 141609
* Extend lvalue evaluation in ExprConstant.cpp to handle CK_LValueBitCast ↵Eli Friedman2011-10-111-0/+4
| | | | | | (which is completely trivial). PR8836. llvm-svn: 141604
* When performing a user-defined conversion via a constructor, be sureDouglas Gregor2011-10-101-0/+15
| | | | | | | to check whether the constructor is accessible. Fixes <rdar://problem/10202900>. llvm-svn: 141588
* Don't suggest 'noreturn' for function template instantiations, becauseDouglas Gregor2011-10-101-6/+26
| | | | | | | it might be wrong for other instantiations of the same function template. Fixes PR10801. llvm-svn: 141559
* Give nicer note when a member redeclaration has or lacks 'const'Kaelyn Uhrain2011-10-102-4/+17
| | | | llvm-svn: 141555
* Don't analyze comparisons in type- or value-dependentDouglas Gregor2011-10-101-1/+23
| | | | | | subexpressions. Fixes PR10291. llvm-svn: 141552
* Parse the initializer for a class member after handling itsDouglas Gregor2011-10-101-0/+4
| | | | | | | declarator, so that the declarator is in scope for the initializer. Fixes PR9989. llvm-svn: 141539
* Push "out-of-line" declarations into scope when their lexical/semanticDouglas Gregor2011-10-091-0/+13
| | | | | | | redeclaration contexts are the same, as occurs within linkage specifications. Fixes PR9162. llvm-svn: 141521
* Only allow taking the address of an expression of type 'overloadedDouglas Gregor2011-10-091-0/+11
| | | | | | | | function type' when that expression is actually an overloaded function reference (and not the address of an overloaded function reference). Fixes PR11066. llvm-svn: 141514
* Diagnose attempts to declare a non-static data member with aDouglas Gregor2011-10-091-0/+5
| | | | | | non-identifier name. Fixes PR10839. llvm-svn: 141513
* constexpr functions are implicitly const. More tests to follow.Richard Smith2011-09-301-1/+1
| | | | llvm-svn: 140831
* Suggest adding 'constexpr' if the GNU extension for in-class initializers ↵Richard Smith2011-09-301-2/+2
| | | | | | for static const float members is used in C++11 mode. llvm-svn: 140828
* Mark the ExtWarn for in-class initialization of static const float members ↵Richard Smith2011-09-292-4/+4
| | | | | | as a GNU extension. Don't extend the scope of this extension to all literal types in C++0x mode. llvm-svn: 140820
* PR11040: CheckICE should not allow an lvalue bitcast as part of an integer ↵Eli Friedman2011-09-291-1/+3
| | | | | | constant expression. llvm-svn: 140812
* In C++0x, static const volatile data members cannot be initialized in-class.Richard Smith2011-09-292-0/+29
| | | | llvm-svn: 140809
* constexpr: semantic checking for constexpr variables.Richard Smith2011-09-291-2/+2
| | | | | | We had an extension which allowed const static class members of floating-point type to have in-class initializers, 'as a C++0x extension'. However, C++0x does not allow this. The extension has been kept, and extended to all literal types in C++0x mode (with a fixit to add the 'constexpr' specifier). llvm-svn: 140801
* c - Enumerators may inherit the deprecated/unavailable Fariborz Jahanian2011-09-291-2/+2
| | | | | | | attributes from the enumeration type. // rdar://10201690 llvm-svn: 140800
* Add support for alignment-specifiers in C1X and C++11, removePeter Collingbourne2011-09-291-6/+6
| | | | | | | support for the C++0x draft [[align]] attribute and add the C1X standard header file stdalign.h llvm-svn: 140796
* Move test, so it actually tests what it is supposed to (given that we don't ↵Eli Friedman2011-09-271-8/+0
| | | | | | have an AST verifier). llvm-svn: 140620
* Revert r140589. It was causing failures during llvm compilation:Bill Wendling2011-09-271-8/+4
| | | | | | | | | | | | | | llvm[1]: Compiling CommandLine.cpp for Debug+Asserts build if /Users/void/llvm/llvm-opt.obj/Release+Asserts/bin/clang++ -I/Users/void/llvm/llvm.obj/include -I/Users/void/llvm/llvm.obj/lib/Support -I/Users/void/llvm/llvm.src/include -I/Users/void/llvm/llvm.src/lib/Support -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -g -fno-exceptions -fno-common -Woverloaded-virtual -Wcast-qual -m64 -Wall -W -Wno-unused-parameter -Wwrite-strings -c -MMD -MP -MF "/Users/void/llvm/llvm.obj/lib/Support/Debug+Asserts/CommandLine.d.tmp" -MT "/Users/void/llvm/llvm.obj/lib/Support/Debug+Asserts/CommandLine.o" -MT "/Users/void/llvm/llvm.obj/lib/Support/Debug+Asserts/CommandLine.d" /Users/void/llvm/llvm.src/lib/Support/CommandLine.cpp -o /Users/void/llvm/llvm.obj/lib/Support/Debug+Asserts/CommandLine.o ; \ then /bin/mv -f "/Users/void/llvm/llvm.obj/lib/Support/Debug+Asserts/CommandLine.d.tmp" "/Users/void/llvm/llvm.obj/lib/Support/Debug+Asserts/CommandLine.d"; else /bin/rm "/Users/void/llvm/llvm.obj/lib/Support/Debug+Asserts/CommandLine.d.tmp"; exit 1; fi In file included from /Users/void/llvm/llvm.src/lib/Support/CommandLine.cpp:25: /Users/void/llvm/llvm.src/include/llvm/Support/system_error.h:690:14: error: unknown type name 'make_error_condition'; did you mean 'error_condition'? {*this = make_error_condition(_e);} ^~~~~~~~~~~~~~~~~~~~ error_condition ... llvm-svn: 140599
* PR11009: Fix a FIXME which was leading to an assertion failure with rvalue ↵Eli Friedman2011-09-271-0/+8
| | | | | | references. llvm-svn: 140594
* Add typo correction for the type name in C++ "new" statementsKaelyn Uhrain2011-09-271-4/+8
| | | | llvm-svn: 140589
* Fix regression of -Warray-bounds involving varargs functions [PR 11007].Ted Kremenek2011-09-261-0/+9
| | | | llvm-svn: 140584
* Move string literal to bool conversion into its own warning flag ↵Richard Trieu2011-09-262-16/+18
| | | | | | -Wstring-conversion. llvm-svn: 140574
* Correctly parse braced member initializers (even in delayed parsing) and ↵Sebastian Redl2011-09-242-21/+34
| | | | | | | | | | | correctly pass the information on to Sema. There's still an incorrectness in the way template instantiation works now, but that is due to a far larger underlying representational problem. Also add a test case for various list initialization cases of scalars, which test this commit as well as the previous one. llvm-svn: 140460
* Fix the expected error for narrowing conversions in ↵Sebastian Redl2011-09-241-2/+2
| | | | | | | | generalized-initializers.cpp to match what the actual implementation of the error looks like. llvm-svn: 140458
* [microsoft] In Microsoft mode, if we are inside a template class member ↵Francois Pichet2011-09-241-0/+22
| | | | | | | | | function and we can't resolve an identifier then assume the identifier is type dependent. The goal is to postpone name lookup to instantiation time to be able to search into type dependent base classes. This fixes a few errors when parsing MFC code with clang. BTW clang trunk is now about 5 patches away to be able the parse the default wizard-generated MFC project. llvm-svn: 140452
* Add a new warning to -Wliteral-conversion to catch cases where a string literalRichard Trieu2011-09-231-0/+16
| | | | | | | | | | | | | | is cast to a boolean. An exception has been made for string literals in logical expressions to allow the common case of use in assert statements. bool x; x = "hi"; // Warn here void foo(bool x); foo("hi"); // Warn here assert(0 && "error"); assert("error); // Warn here llvm-svn: 140405
* When checking for weak vtables, check whether the actual definition ofDouglas Gregor2011-09-231-0/+27
| | | | | | | | the key function is inline, rather than the original declaration. Perhaps FunctionDecl::isInlined() is poorly named. Fixes <rdar://problem/9979458>. llvm-svn: 140400
* [microsoft] Move missing typename warning from -fms-extensions to ↵Francois Pichet2011-09-212-34/+44
| | | | | | -fms-compatibility. Also allow the missing typename warning at function scope. llvm-svn: 140240
* Move Microsoft access specifier bug emulation from -fms-extensions to ↵Francois Pichet2011-09-202-20/+20
| | | | | | -fm-compatibility. llvm-svn: 140189
OpenPOWER on IntegriCloud