summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclCXX.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* When typo-correcting a member using declaration, don't exclude member templates.Richard Smith2014-04-301-4/+0
| | | | llvm-svn: 207681
* When typo-correcting a member using-declaration, only consider members of ↵Richard Smith2014-04-301-10/+11
| | | | | | base classes. llvm-svn: 207680
* Fix crash if typo correction corrects a member using-declaration to aRichard Smith2014-04-301-0/+6
| | | | | | non-member declaration. Patch by Dinesh Dwivedi! llvm-svn: 207677
* Initial implementation of -modules-earch-all option, for searching for ↵John Thompson2014-04-231-3/+5
| | | | | | symbols in non-imported modules. llvm-svn: 206977
* PR18746: If a constexpr function has a dependent return type and no returnRichard Smith2014-04-221-2/+4
| | | | | | | | statements, don't diagnose; the return type might end up being 'void'. Patch by Rahul Jain! Tiny tweaks by me. llvm-svn: 206929
* When a module completes the definition of a class template specialization ↵Richard Smith2014-04-191-8/+8
| | | | | | imported from another module, emit an update record, rather than using the broken decl rewriting mechanism. If multiple modules do this, merge the definitions together, much as we would if they were separate declarations. llvm-svn: 206680
* Refactor all the checking for missing 'template<>'s when a declaration has aRichard Smith2014-04-171-1/+1
| | | | | | template-id after its scope specifier into a single place. llvm-svn: 206442
* PR19415: Converting 'constexpr' to 'const' in a non-static data member can failRichard Smith2014-04-141-8/+13
| | | | | | if the member is already 'const'. Don't assert in that case. llvm-svn: 206205
* Fix handling of redeclaration lookup for using declarations, where the priorRichard Smith2014-04-111-0/+7
| | | | | | | | | | | declaration is not visible. Previously we didn't find hidden friend names in this redeclaration lookup, because we forgot to treat it as a redeclaration lookup. Conversely, we did find some local extern names, but those don't actually conflict with a namespace-scope using declaration, because the only conflicts we can get are scope conflicts, not conflicts due to the entities being members of the same namespace. llvm-svn: 206011
* If a using-declaration names a class member, but appears outside a class, tryRichard Smith2014-04-021-1/+50
| | | | | | to suggest a different syntax to get the same effect. llvm-svn: 205467
* Sema: Implement DR317David Majnemer2014-03-301-0/+8
| | | | | | | | | | | | | | | Summary: Declaring a function as inline after it has been defined is in violation of [dcl.fct.spec]p4. The program would get a strong definition instead of getting a function with linkonce_odr linkage. Reviewers: rsmith CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3220 llvm-svn: 205129
* Don't emit exit-time destructor warnings for trivial explicitly defaulted dtorsStephan Tolksdorf2014-03-271-1/+2
| | | | | | | | This commit also adds an additional test case for the global destructor warning. Reviewed in http://llvm-reviews.chandlerc.com/D3205 llvm-svn: 204954
* -Wglobal-constructors: Don't warn on trivial defaulted dtorsReid Kleckner2014-03-261-1/+1
| | | | | | Fixes PR19253. llvm-svn: 204825
* When the exception specification for a function in an imported PCH or module isRichard Smith2014-03-201-12/+5
| | | | | | resolved, emit an update record. llvm-svn: 204403
* Replacing the exclusive_lock_function, shared_lock_function and ↵Aaron Ballman2014-03-201-7/+1
| | | | | | | | unlock_function attributes with the acquire_capability and release_capability attributes. The old spellings will continue to work, but the underlying semantic attributes have been replaced. Downgraded the capability diagnostics from error to warning to match the desired behavior, and updated the existing test cases. llvm-svn: 204350
* [C++11] Replacing FunctionProtoType iterators exception_begin() and ↵Aaron Ballman2014-03-171-9/+5
| | | | | | exception_end() with iterator_range exceptions(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 204046
* [C++11] Replacing CompoundStmt iterators body_begin() and body_end() with ↵Aaron Ballman2014-03-171-6/+4
| | | | | | iterator_range body(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 204040
* [C++11] Replacing DeclStmt iterators decl_begin() and decl_end() with ↵Aaron Ballman2014-03-141-6/+5
| | | | | | iterator_range decls(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203947
* [C++11] Replacing CXXRecordDecl iterators init_begin() and init_end() with ↵Aaron Ballman2014-03-131-12/+6
| | | | | | iterator_range inits(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203819
* [C++11] Replacing CXXRecordDecl iterators ctor_begin() and ctor_end() with ↵Aaron Ballman2014-03-131-16/+10
| | | | | | iterator_range ctors(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203814
* [C++11] Replacing CXXRecordDecl iterators method_begin() and method_end() ↵Aaron Ballman2014-03-131-24/+16
| | | | | | with iterator_range methods(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203812
* [C++11] Replacing CXXRecordDecl iterators vbases_begin() and vbases_end() ↵Aaron Ballman2014-03-131-61/+37
| | | | | | with iterator_range vbases(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203808
* [C++11] Replacing CXXRecordDecl iterators bases_begin() and bases_end() with ↵Aaron Ballman2014-03-131-112/+76
| | | | | | iterator_range bases(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203803
* Only allow streaming exactly type 'bool' to a DiagnosticBuilder, not anythingRichard Smith2014-03-121-2/+1
| | | | | | | that implicitly converts to 'bool' (such as pointers, and the first operand of ?:). Clean up issues found by this. Patch by Stephan Tolksdorf! llvm-svn: 203735
* [C++11] Replacing Decl iterators attr_begin() and attr_end() with ↵Aaron Ballman2014-03-081-24/+17
| | | | | | | | iterator_range attrs(). Updating all of the usages of the iterators with range-based for loops. This is a reapplication of r203236 with modifications to the definition of attrs() and following the new style guidelines on auto usage. llvm-svn: 203362
* [C++11] Replacing RecordDecl iterators field_begin() and field_end() with ↵Aaron Ballman2014-03-081-66/+31
| | | | | | iterator_range fields(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203355
* [C++11] Replacing DeclBase iterators decls_begin() and decls_end() with ↵Aaron Ballman2014-03-071-15/+9
| | | | | | iterator_range decls(). The same is true for the noload versions of these APIs. Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203278
* Renaming the chains() ranged iterator to chain() per suggestion by Richard ↵Aaron Ballman2014-03-071-2/+2
| | | | | | Smith. llvm-svn: 203262
* [C++11] Replacing IndirectFieldDecl iterators chain_begin() and chain_end() ↵Aaron Ballman2014-03-071-8/+4
| | | | | | with iterator_range chains(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203261
* [C++11] Replacing FunctionDecl iterators param_begin() and param_end() with ↵Aaron Ballman2014-03-071-15/+10
| | | | | | iterator_range params(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203248
* Fully reverting r203236 -- it seems the only bots that are happy are the ↵Aaron Ballman2014-03-071-17/+24
| | | | | | MSVC bots. llvm-svn: 203237
* [C++11] Replacing iterators attr_begin() and attr_end() with iterator_range ↵Aaron Ballman2014-03-071-24/+17
| | | | | | attrs(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203236
* [C++11] Replacing iterators redecls_begin() and redecls_end() with ↵Aaron Ballman2014-03-061-4/+2
| | | | | | iterator_range redecls(). Updating all of the usages of the iterators with range-based for loops, which allows the begin/end forms to be removed entirely. llvm-svn: 203179
* Switch all uses of LLVM_OVERRIDE to just use 'override' directly.Craig Topper2014-03-021-13/+12
| | | | llvm-svn: 202625
* Diagnose attempts to apply ms_struct to records with base classesJohn McCall2014-02-271-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | or virtual functions, but permit that error to be downgraded to a warning (with -Wno-error=incompatible-ms-struct), and officially support this kind of dual, ABI-mixing layout. The basic problem here is that projects which use ms_struct are often not very circumspect about what types they annotate; for example, some projects enable the pragma in a prefix header and then only selectively disable it around system header inclusions. They may only care about binary compatibility with MSVC for a subset of those structs, but that doesn't mean they have no binary compatibility concerns at all for the rest; thus we are essentially forced into supporting this hybrid ABI. But it's reasonable for us to at least point out the places where we're not making any guarantees. The original diagnostic was for dynamic classes, i.e. those with virtual functions or virtual bases; I've extended it to include all classes with bases, because we are not actually making any attempt to duplicate MSVC's base subobject layout in ms_struct (and it is indeed quite different from Itanium, even for non-virtual bases). rdar://16178895 llvm-svn: 202427
* argument -> parameter terminology fixes for FunctionTypeInfoAlp Toker2014-02-261-11/+11
| | | | | | This is a continuation of r199686. llvm-svn: 202307
* [Win32 ABI] Defer operator delete checks until vtable is marked usedHans Wennborg2014-02-241-9/+12
| | | | | | | | | | We were previously checking at every destructor declaration, but that was a bit excessive. Since the deleting destructor is emitted with the vtable, do the check when the vtable is marked used. Differential Revision: http://llvm-reviews.chandlerc.com/D2851 llvm-svn: 202046
* Adding role-based capability attributes that allow you to express role ↵Aaron Ballman2014-02-211-0/+7
| | | | | | | | management: asserting a capability is held, acquiring a capability and releasing a capability. Also includes some skeleton documentation for these new attributes. This functionality should be considered a WIP. llvm-svn: 201890
* DeLesley Hutchins (who wrote the original thread-safety attribute ↵Aaron Ballman2014-02-181-6/+3
| | | | | | | | | | | | | | | functionality) and I have agreed to start migrating from lock-specific terminology to "capability"-specific terminology. This opens the door for future threading-related analysis passes so that a common nomenclature can be used. The following attributes have been (silently) deprecated, with their replacements listed: lockable => capability exclusive_locks_required => requires_capability shared_locks_required => requires_shared_capability locks_excluded => requires_capability There are no functional changes intended. llvm-svn: 201585
* PR18870: Parse language linkage specifiers properly if the string-literal isRichard Smith2014-02-171-16/+21
| | | | | | spelled in an interesting way. llvm-svn: 201536
* DR101, PR12770: If a function is declared in the same context as aRichard Smith2014-02-061-1/+1
| | | | | | | | using-declaration, and they declare the same function (either because the using-declaration is in the same namespace as the declaration it imports, or because they're both extern "C"), they do not conflict. llvm-svn: 200897
* Add implicit declarations of allocation functions when looking them up forRichard Smith2014-02-041-3/+6
| | | | | | | | redeclaration, not just when looking them up for a use -- we need the implicit declaration to appropriately check various properties of them (notably, whether they're deleted). llvm-svn: 200729
* PR14995: Allow a dependent type as the second parameter of operator++ andRichard Smith2014-01-301-4/+3
| | | | | | | operator--, since it might instantiate as 'int' (or, if it's a pack, it might instantiate as an empty pack). llvm-svn: 200496
* Rename getResultLoc() tooAlp Toker2014-01-251-2/+2
| | | | | | | | Follow up to r200082. Spotted by Dmitri llvm-svn: 200105
* Rename getResultType() on function and method declarations to getReturnType()Alp Toker2014-01-251-14/+14
| | | | | | | | | | | | | | | A return type is the declared or deduced part of the function type specified in the declaration. A result type is the (potentially adjusted) type of the value of an expression that calls the function. Rule of thumb: * Declarations have return types and parameters. * Expressions have result types and arguments. llvm-svn: 200082
* When a special member is explicitly defaulted outside its class, and we rejectRichard Smith2014-01-221-0/+1
| | | | | | | the defaulting because it would delete the member, produce additional notes explaining why the member is implicitly deleted. llvm-svn: 199829
* Introduce and use Decl::getAsFunction() to simplify templated function checksAlp Toker2014-01-221-7/+1
| | | | | | | | | | | | | | Lift the getFunctionDecl() utility out of the parser into a general Decl::getAsFunction() and use it to simplify other parts of the implementation. Reduce isFunctionOrFunctionTemplate() to a simple type check that works the same was as the other is* functions and move unwrapping of shadowed decls to callers so it doesn't get run twice. Shuffle around canSkipFunctionBody() to reduce virtual dispatch on ASTConsumer. There's no need to query when we already know the body can't be skipped. llvm-svn: 199794
* Enforce restrictions that 'main' is not allowed to be deleted, or to be used byRichard Smith2014-01-221-0/+5
| | | | | | | | the program, in C++. (We allow the latter as an extension, since we've always permitted it, and GCC does the same, and our supported C++ ABIs don't do anything special in main.) llvm-svn: 199782
* Update FunctionTypeLoc and related names to match r199686Alp Toker2014-01-211-8/+8
| | | | llvm-svn: 199699
* Rename FunctionProtoType accessors from 'arguments' to 'parameters'Alp Toker2014-01-201-18/+20
| | | | | | | | | | | | | | | | | Fix a perennial source of confusion in the clang type system: Declarations and function prototypes have parameters to which arguments are supplied, so calling these 'arguments' was a stretch even in C mode, let alone C++ where default arguments, templates and overloading make the distinction important to get right. Readability win across the board, especially in the casting, ADL and overloading implementations which make a lot more sense at a glance now. Will keep an eye on the builders and update dependent projects shortly. No functional change. llvm-svn: 199686
OpenPOWER on IntegriCloud