summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX
Commit message (Collapse)AuthorAgeFilesLines
* C++1y: support simple variable assignments in constexpr functions.Richard Smith2013-04-265-8/+165
| | | | llvm-svn: 180603
* Add r180263 back, but fix hasBraces() to be correct during parsing.Rafael Espindola2013-04-261-0/+7
| | | | | | | | Original commit message: Fix a case in linkage computation that should check for single line extern "C". llvm-svn: 180591
* Add a testcase for a recent regression.Rafael Espindola2013-04-261-0/+9
| | | | | | Thanks to Bill Wendling for the original testcase. llvm-svn: 180586
* Revert r180263. It's causing failures.Bill Wendling2013-04-251-7/+0
| | | | llvm-svn: 180583
* Put friend decls in the correct context.Rafael Espindola2013-04-251-0/+12
| | | | | | | | | | When we find a friend declaration we have to skip transparent contexts for doing lookups, but we should not skip them when inserting the new decl if the lookup found nothing. Fixes PR15841. llvm-svn: 180571
* Fix a case in linkage computation that should check for single line extern "C".Rafael Espindola2013-04-251-0/+7
| | | | llvm-svn: 180263
* Warn that scoped enumerations are a C++11 extenstion when compiling inRichard Trieu2013-04-231-0/+2
| | | | | | | C++98 mode. This improves on the previous diagnostic message of: error: expected identifier or '{' llvm-svn: 180076
* C++1y constexpr extensions, round 1: Allow most forms of declaration andRichard Smith2013-04-222-0/+133
| | | | | | | | statement in constexpr functions. Everything which doesn't require variable mutation is also allowed as an extension in C++11. 'void' becomes a literal type to support constexpr functions which return 'void'. llvm-svn: 180022
* Fix array constant expression evaluation bug: we can have different values forRichard Smith2013-04-221-0/+18
| | | | | | | different array elements, even if they're all constructed using the same default constructor. llvm-svn: 180017
* Add a triple to make a test resilient to non-TLS hosts (eg: darwin10)David Blaikie2013-04-221-1/+1
| | | | | | Making the test introduced in r179962 resilient to being run on darwin10 hosts. llvm-svn: 179992
* The 'constexpr implies const' rule for non-static member functions is gone inRichard Smith2013-04-213-17/+35
| | | | | | | | | C++1y, so stop adding the 'const' there. Provide a compatibility warning for code relying on this in C++11, with a fix-it hint. Update our lazily-written tests to add the const, except for those ones which were testing our implementation of this rule. llvm-svn: 179969
* Disable VLA diagnostic in C++1y mode, and add some tests.Richard Smith2013-04-202-0/+73
| | | | | | | | | | | | Still to do here: - we have a collection of syntactic accepts-invalids to diagnose - support non-PODs in VLAs, including dynamic initialization / destruction - runtime checks (and throw std::bad_array_length) for bad bound - support VLA capture by reference in lambdas - properly support VLAs in range-based for (don't recompute bound) llvm-svn: 179962
* C++1y: Allow aggregates to have default initializers.Richard Smith2013-04-201-0/+63
| | | | | | | | | | | Add a CXXDefaultInitExpr, analogous to CXXDefaultArgExpr, and use it both in CXXCtorInitializers and in InitListExprs to represent a default initializer. There's an additional complication here: because the default initializer can refer to the initialized object via its 'this' pointer, we need to make sure that 'this' points to the right thing within the evaluation. llvm-svn: 179958
* Implement core issue 1608: class members can be found via operator lookup in ↵Richard Smith2013-04-201-0/+9
| | | | | | a trailing return type in that class's body. llvm-svn: 179941
* Note that we support (and in fact have supported since the dawn of time itself)Richard Smith2013-04-191-0/+6
| | | | | | C++1y binary literals. llvm-svn: 179883
* Revert r179671 and just pass a triple to the test for a platform with knownEric Christopher2013-04-171-2/+1
| | | | | | TLS support. llvm-svn: 179692
* Fix PR15291: noreturn adjustment in overload resolution for function ↵Douglas Gregor2013-04-171-0/+83
| | | | | | templates, from Alexander Zinenko! llvm-svn: 179680
* Add a bit of a hack to deal with a failing testcase on darwin10 bots.Eric Christopher2013-04-171-0/+1
| | | | | | | | | | | | | | We currently emit an error message when you try to use thread local storage on targets that don't support it and testing C++11 thread locals will trip this. We don't want to xfail the test for all darwin hosts so add a quick hack to check for darwin10 and disable the test based on that. Only checking darwin10 because anything earlier is really old and I don't have a list of what other hosts don't support tls handy. Alternate suggestions welcome! llvm-svn: 179671
* Don't put too much thought into whether or not to capture aJohn McCall2013-04-161-4/+5
| | | | | | | | | type-dependent intermediate result in a postfix ++ pseudo- object operation. Test case by Tong Shen. llvm-svn: 179637
* Sema for Captured StatementsTareq A. Siraj2013-04-161-0/+52
| | | | | | | | | | | | | Add CapturedDecl to be the DeclContext for CapturedStmt, and perform semantic analysis. Currently captures all variables by reference. TODO: templates Author: Ben Langmuir <ben.langmuir@intel.com> Differential Revision: http://llvm-reviews.chandlerc.com/D433 llvm-svn: 179618
* Suppress unused warning on static inline function template specializations.Rafael Espindola2013-04-161-0/+21
| | | | | | Patch by Halfdan Ingvarsson! llvm-svn: 179598
* Basic support for Microsoft property declarations andJohn McCall2013-04-161-0/+124
| | | | | | | | references thereto. Patch by Tong Shen! llvm-svn: 179585
* Local thread_local variables are implicitly 'static'. (This doesn't apply to ↵Richard Smith2013-04-151-0/+23
| | | | | | _Thread_local nor __thread.) llvm-svn: 179517
* Suppress -Wunused-variable for variables declared in headers, which may inMatt Beaumont-Gay2013-04-103-9/+23
| | | | | | | | | | | fact be defined and used in another TU. Reshuffle some test cases because we suppress -Wunused-variable after we've emitted an error. This fixes PR15558. llvm-svn: 179138
* Mark as referenced the functions from instantiated UserDefinedLiterals.Argyrios Kyrtzidis2013-04-091-0/+13
| | | | | | Fixes rdar://13589856 llvm-svn: 179078
* Thread safety analysis: turn on checking within lock and unlock functions.DeLesley Hutchins2013-04-081-10/+80
| | | | | | These checks are enabled with the -Wthread-safety-beta flag. llvm-svn: 179046
* When -Woverloaded-virtual is triggered, call HandleFunctionTypeMismatch to addRichard Trieu2013-04-051-0/+18
| | | | | | | more information to the notes. This information is already present on other diagnostic messages that involves overloads. llvm-svn: 178923
* Don't patch the storage class of static data members.Rafael Espindola2013-04-041-0/+5
| | | | | | | | | | This removes a bit of patching that survived r178663. Without it we can produce better a better error message for const int a = 5; static const int a; llvm-svn: 178795
* Use isExternalLinkage instead of hasExternalLinkage.Rafael Espindola2013-04-041-0/+7
| | | | | | | | | | | | | | | | Having these not be the same makes an easy to misuse API. We should audit the uses and probably rename to something like foo->hasExternalLinkage(): The c++ standard one. That is UniqueExternalLinkage or ExternalLinkage. foo->hasUniqueExternalLinkage(): Is UniqueExternalLinkage. foo->hasCogeGenExternalLinkage(): Is ExternalLinkage. llvm-svn: 178768
* Fix a recent linkage regression.Rafael Espindola2013-04-041-0/+6
| | | | | | | | Now that we don't have a semantic storage class, use the linkage. Thanks to Bruce Stephens for reporting this. llvm-svn: 178766
* Fix linkage related crash.Rafael Espindola2013-04-041-0/+8
| | | | | | | | This test was exactly the opposite of what it should be. We should check if there old decl has linkage (where it makes sense) and if the new decl has the extern keyword. llvm-svn: 178735
* Fix 41 of the 61 tests which fail with modules enabled: we were computing andRichard Smith2013-04-041-0/+1
| | | | | | | | | caching the linkage for a declaration before we set up its redeclaration chain, when determining whether a declaration could be a redeclaration of something from an unimported submodule. We actually want to look at the declaration as if it were not a redeclaration here, so compute the linkage but don't cache it. llvm-svn: 178733
* Complain about attempts to befriend declarations via a usingJohn McCall2013-04-031-0/+16
| | | | | | declaration. Patch by Stephen Lin! llvm-svn: 178698
* Give the default CorrectionCandidateCallback::ValidateCandidate someKaelyn Uhrain2013-04-031-0/+10
| | | | | | | | smarts so that it doesn't approve of keywords and/or type names when it knows (based on its flags) that those kinds of corrections are not wanted. llvm-svn: 178668
* Moved fallthrough regression test to switch-implicit-fallthrough.cpp.Alexander Kornienko2013-04-022-17/+18
| | | | llvm-svn: 178554
* Fixed "fallthrough annotation does not directly precede switch label" warning inAlexander Kornienko2013-04-021-0/+17
| | | | | | case when [[clang::fallthrough]]; is used in a method of a local class. llvm-svn: 178543
* PR15633: Note that we are EnteringContext when parsing the nested nameRichard Smith2013-04-011-0/+14
| | | | | | | specifier for an enumeration. Also fix a crash-on-invalid if a non-dependent name specifier is used to declare an enum template. llvm-svn: 178502
* Don't special case one line extern "C" decls.Rafael Espindola2013-03-291-0/+4
| | | | | | | | | | | | | | We already avoided warning for extern "C" const char *Version_string = "2.9"; now we also don't produce any warnings for extern "C" { extern const char *Version_string2 = "2.9"; } llvm-svn: 178333
* [ms-cxxabi] Add more tests for r178297Reid Kleckner2013-03-281-0/+33
| | | | | | | This covers a few cases where the class of a member pointer is not a CXXRecordDecl. llvm-svn: 178307
* [ms-cxxabi] Correctly compute the size of member pointersReid Kleckner2013-03-281-11/+131
| | | | | | | | | | | | | | | | | Summary: This also relaxes the requirement on Windows that the member pointer class type be a complete type (http://llvm.org/PR12070). We still ask for a complete type to instantiate any templates (MSVC does this), but if that fails we continue as normal, relying on any inheritance attributes on the declaration. Reviewers: rjmccall CC: triton, timurrrr, cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D568 llvm-svn: 178283
* Provide a fixit to static_cast for reinterpret_casts within a class hierarchy.Jordan Rose2013-03-281-0/+42
| | | | | | | | | The suggestion was already in the text of the note; this just adds the actual fixit and the appropriate test cases. Patch by Alexander Zinenko! llvm-svn: 178274
* For -Wignored-qualifiers, don't warn on qualifiers which we acquire via aRichard Smith2013-03-281-2/+1
| | | | | | | typedef. Also don't warn on the _Atomic type specifier, just on the _Atomic type qualifier. llvm-svn: 178218
* Teach -Wigored-qualifiers about exotic flavors of declarator and the _Atomic ↵Richard Smith2013-03-281-1/+24
| | | | | | type qualifier. llvm-svn: 178217
* Support C11 _Atomic type qualifier. This is more-or-less just syntactic ↵Richard Smith2013-03-281-1/+24
| | | | | | sugar for the _Atomic type specifier. llvm-svn: 178210
* Implement compiler intrinsics needed for compatibility with MSVC 2012 ↵Joao Matos2013-03-271-3/+116
| | | | | | | | <type_traits>. Patch by me and Ryan Molden. llvm-svn: 178111
* PR15597: Fix a confusion between the implicit exception specification and theRichard Smith2013-03-271-1/+14
| | | | | | | | uninstantiated exception specification when a special member within a class template is both defaulted and given an exception specification on its first declaration. llvm-svn: 178103
* Make the -Wreinterpret-base-class logic safe against invalidJohn McCall2013-03-271-0/+47
| | | | | | | declarations at any point. Patch by Alexander Zinenko, and report by Richard Smith. llvm-svn: 178098
* <rdar://problem/13267210> Ensure that Sema::CompareReferenceRelationship ↵Douglas Gregor2013-03-261-2/+4
| | | | | | | | | | | | | returns consistent results with invalid types. When Sema::RequireCompleteType() is given a class template specialization type that then fails to instantiate, it returns 'true'. On subsequent invocations, it can return false. Make sure that this difference doesn't change the result of Sema::CompareReferenceRelationship, which is expected to remain stable while we're checking an initialization sequence. llvm-svn: 178088
* Handle CXXOperatorCallExpr when checking self referrnce during initialization ofRichard Trieu2013-03-261-0/+15
| | | | | | class types. llvm-svn: 177987
* <rdar://problem/13185264> Don't crash when attempting to redundantly ↵Douglas Gregor2013-03-251-0/+8
| | | | | | initialize a member of an anonymous union. llvm-svn: 177941
OpenPOWER on IntegriCloud