Alp Toker
15e62a37f0
Fix typos
...
llvm-svn: 210328
2014-06-06 12:02:07 +00:00
Aaron Ballman
9ef622e5bf
The exception-declaration for a function-try-block cannot redeclare a
...
function parameter. One of our existing test cases was XFAILed because
of this. This fixes the issue and un-XFAILs the test.
llvm-svn: 210026
2014-06-02 13:10:07 +00:00
Hans Wennborg
496524b448
Diagnose dll attribute on member of class that already has a dll attribute
...
Differential Revision: http://reviews.llvm.org/D3973
llvm-svn: 209954
2014-05-31 02:08:49 +00:00
Hans Wennborg
853ae94660
Start adding support for dllimport/dllexport on classes (PR11170)
...
This implements the central part of support for dllimport/dllexport on
classes: allowing the attribute on class declarations, inheriting it
to class members, and forcing emission of exported members. It's based
on Nico Rieck's patch from http://reviews.llvm.org/D1099 .
This patch doesn't propagate dllexport to bases that are template
specializations, which is an interesting problem. It also doesn't
look at the rules when redeclaring classes with different attributes,
I'd like to do that separately.
Differential Revision: http://reviews.llvm.org/D3877
llvm-svn: 209908
2014-05-30 16:59:42 +00:00
Nico Rieck
9de0a57687
Sema: Functions with dll attributes cannot be deleted
...
llvm-svn: 209827
2014-05-29 16:51:19 +00:00
Nikola Smiljanic
03ff2596cb
Refactoring. Remove Owned method from Sema.
...
llvm-svn: 209812
2014-05-29 14:05:12 +00:00
Nikola Smiljanic
01a7598561
Refactoring. Remove release and take methods from ActionResult. Rename takeAs to getAs.
...
llvm-svn: 209800
2014-05-29 10:55:11 +00:00
Alp Toker
2afa8780d6
Consolidate some note diagnostics
...
These note diags have the same message and can be unified further but for now
let's just bring them together.
Incidental change: Display a source range in the final attr diagnostic.
llvm-svn: 209728
2014-05-28 12:20:14 +00:00
Craig Topper
c3ec149bb2
[C++11] Use 'nullptr'. Sema edition.
...
llvm-svn: 209613
2014-05-26 06:22:03 +00:00
Nikola Smiljanic
3a01af0805
PR19352 - getLocation() points to the wrong position for FriendDecls
...
llvm-svn: 209511
2014-05-23 12:48:27 +00:00
Yaron Keren
885ea4253d
DeclVisitor is not used here.
...
llvm-svn: 209285
2014-05-21 09:02:49 +00:00
Yaron Keren
065da7c53a
Fixed spelling.
...
llvm-svn: 209224
2014-05-20 18:23:05 +00:00
Alp Toker
4284c6e7a4
Consolidate single void paramter checking
...
Also correct argument/parameter terminology.
No change in functionality.
llvm-svn: 208498
2014-05-11 16:05:55 +00:00
David Blaikie
04e2e665cb
Don't emit -Wnon-virtual-dtor on final classes, since it's not a problem there.
...
The base class is the culprit/risk here - a sealed/final derived class
with virtual functions and a non-virtual dtor can't accidentally be
polymorphically destroyed (if the base class's dtor is protected - which
also suppresses this warning).
llvm-svn: 208449
2014-05-09 22:02:28 +00:00
Alp Toker
a030cd0558
StringRefize and take out an old FIXME
...
llvm-svn: 207962
2014-05-05 12:38:48 +00:00
Nick Lewycky
d78f92fbb2
Rewrite NRVO determination. Track NRVO candidates on the parser Scope and apply the NRVO candidate flag to all possible NRVO candidates here, and remove the flags in computeNRVO or upon template instantiation. A variable now has NRVO applied if and only if every return statement in that scope returns that variable. This is nearly optimal.
...
Performs NRVO roughly 7% more often in a bootstrap build of clang. Patch co-authored by Richard Smith.
llvm-svn: 207890
2014-05-03 00:41:18 +00:00
Hans Wennborg
b6d4e8cd4e
Handle -fdelayed-template-parsing of out-of-line definitions of
...
class template member classes (PR19613)
Also improve this code in general by implementing suggestions
from Richard.
Differential Revision: http://reviews.llvm.org/D3555?id=9020
llvm-svn: 207822
2014-05-02 02:01:07 +00:00
Richard Smith
09d5b3a928
Make typo-correction of inheriting constructors work a bit better. Limit
...
correction to direct base class members, and recover properly after we apply
such a correction.
llvm-svn: 207731
2014-05-01 00:35:04 +00:00
Richard Smith
d94f2f16bd
When typo-correcting a member using declaration, don't exclude member templates.
...
llvm-svn: 207681
2014-04-30 18:15:00 +00:00
Richard Smith
21866c3267
When typo-correcting a member using-declaration, only consider members of base classes.
...
llvm-svn: 207680
2014-04-30 18:03:21 +00:00
Richard Smith
30a615dca8
Fix crash if typo correction corrects a member using-declaration to a
...
non-member declaration. Patch by Dinesh Dwivedi!
llvm-svn: 207677
2014-04-30 17:40:35 +00:00
John Thompson
2255f2ce90
Initial implementation of -modules-earch-all option, for searching for symbols in non-imported modules.
...
llvm-svn: 206977
2014-04-23 12:57:01 +00:00
Richard Smith
06ffb45ce4
PR18746: If a constexpr function has a dependent return type and no return
...
statements, don't diagnose; the return type might end up being 'void'.
Patch by Rahul Jain! Tiny tweaks by me.
llvm-svn: 206929
2014-04-22 23:14:23 +00:00
Richard Smith
cd45dbc5f2
When a module completes the definition of a class template specialization 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
2014-04-19 03:48:30 +00:00
Richard Smith
4b55a9c841
Refactor all the checking for missing 'template<>'s when a declaration has a
...
template-id after its scope specifier into a single place.
llvm-svn: 206442
2014-04-17 03:29:33 +00:00
Richard Smith
82dce550c8
PR19415: Converting 'constexpr' to 'const' in a non-static data member can fail
...
if the member is already 'const'. Don't assert in that case.
llvm-svn: 206205
2014-04-14 21:00:40 +00:00
Richard Smith
83e78f5c3c
Fix handling of redeclaration lookup for using declarations, where the prior
...
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
2014-04-11 01:03:38 +00:00
Richard Smith
7ad0b88396
If a using-declaration names a class member, but appears outside a class, try
...
to suggest a different syntax to get the same effect.
llvm-svn: 205467
2014-04-02 21:44:35 +00:00
David Majnemer
ee4f4025c3
Sema: Implement DR317
...
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
2014-03-30 06:44:54 +00:00
Stephan Tolksdorf
5604a27788
Don't emit exit-time destructor warnings for trivial explicitly defaulted dtors
...
This commit also adds an additional test case for the global destructor warning.
Reviewed in http://llvm-reviews.chandlerc.com/D3205
llvm-svn: 204954
2014-03-27 20:23:36 +00:00
Reid Kleckner
c511f43b67
-Wglobal-constructors: Don't warn on trivial defaulted dtors
...
Fixes PR19253.
llvm-svn: 204825
2014-03-26 15:58:20 +00:00
Richard Smith
564417a071
When the exception specification for a function in an imported PCH or module is
...
resolved, emit an update record.
llvm-svn: 204403
2014-03-20 21:47:22 +00:00
Aaron Ballman
18d85aed39
Replacing the exclusive_lock_function, shared_lock_function and 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
2014-03-20 16:02:49 +00:00
Aaron Ballman
b088fbee3f
[C++11] Replacing FunctionProtoType iterators exception_begin() and exception_end() with iterator_range exceptions(). Updating all of the usages of the iterators with range-based for loops.
...
llvm-svn: 204046
2014-03-17 15:38:09 +00:00
Aaron Ballman
c7e4e219b5
[C++11] Replacing CompoundStmt iterators body_begin() and body_end() with iterator_range body(). Updating all of the usages of the iterators with range-based for loops.
...
llvm-svn: 204040
2014-03-17 14:19:37 +00:00
Aaron Ballman
535bbcccb1
[C++11] Replacing DeclStmt iterators decl_begin() and decl_end() with iterator_range decls(). Updating all of the usages of the iterators with range-based for loops.
...
llvm-svn: 203947
2014-03-14 17:01:24 +00:00
Aaron Ballman
0ad78303de
[C++11] Replacing CXXRecordDecl iterators init_begin() and init_end() with iterator_range inits(). Updating all of the usages of the iterators with range-based for loops.
...
llvm-svn: 203819
2014-03-13 17:34:31 +00:00
Aaron Ballman
2a4bd6d189
[C++11] Replacing CXXRecordDecl iterators ctor_begin() and ctor_end() with iterator_range ctors(). Updating all of the usages of the iterators with range-based for loops.
...
llvm-svn: 203814
2014-03-13 16:51:27 +00:00
Aaron Ballman
2b124d1a5d
[C++11] Replacing CXXRecordDecl iterators method_begin() and method_end() with iterator_range methods(). Updating all of the usages of the iterators with range-based for loops.
...
llvm-svn: 203812
2014-03-13 16:36:16 +00:00
Aaron Ballman
445a939db8
[C++11] Replacing CXXRecordDecl iterators vbases_begin() and vbases_end() with iterator_range vbases(). Updating all of the usages of the iterators with range-based for loops.
...
llvm-svn: 203808
2014-03-13 16:15:17 +00:00
Aaron Ballman
574705ed7f
[C++11] Replacing CXXRecordDecl iterators bases_begin() and bases_end() with iterator_range bases(). Updating all of the usages of the iterators with range-based for loops.
...
llvm-svn: 203803
2014-03-13 15:41:46 +00:00
Richard Smith
5b5d21ea1a
Only allow streaming exactly type 'bool' to a DiagnosticBuilder, not anything
...
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
2014-03-12 23:36:42 +00:00
Aaron Ballman
b97112e4bd
[C++11] Replacing Decl iterators attr_begin() and attr_end() with 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
2014-03-08 22:19:01 +00:00
Aaron Ballman
e8a8baef44
[C++11] Replacing RecordDecl iterators field_begin() and field_end() with iterator_range fields(). Updating all of the usages of the iterators with range-based for loops.
...
llvm-svn: 203355
2014-03-08 20:12:42 +00:00
Aaron Ballman
629afaefe0
[C++11] Replacing DeclBase iterators decls_begin() and decls_end() with 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
2014-03-07 19:56:05 +00:00
Aaron Ballman
29c9460d3e
Renaming the chains() ranged iterator to chain() per suggestion by Richard Smith.
...
llvm-svn: 203262
2014-03-07 18:36:15 +00:00
Aaron Ballman
1391608234
[C++11] Replacing IndirectFieldDecl iterators chain_begin() and chain_end() with iterator_range chains(). Updating all of the usages of the iterators with range-based for loops.
...
llvm-svn: 203261
2014-03-07 18:11:58 +00:00
Aaron Ballman
f6bf62e2d0
[C++11] Replacing FunctionDecl iterators param_begin() and param_end() with iterator_range params(). Updating all of the usages of the iterators with range-based for loops.
...
llvm-svn: 203248
2014-03-07 15:12:56 +00:00
Aaron Ballman
7dce1a840c
Fully reverting r203236 -- it seems the only bots that are happy are the MSVC bots.
...
llvm-svn: 203237
2014-03-07 13:13:38 +00:00
Aaron Ballman
690829696c
[C++11] Replacing iterators attr_begin() and attr_end() with iterator_range attrs(). Updating all of the usages of the iterators with range-based for loops.
...
llvm-svn: 203236
2014-03-07 12:50:00 +00:00