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
Richard Smith
8e6002f3bd
Fix crash if delayed template parsing meets an erroneous trailing return type.
...
Based on a patch and test by Stephan Tolksdorf! Refactoring and fixing adjacent
brokenness by me.
llvm-svn: 203733
2014-03-12 23:14:33 +00:00
Fariborz Jahanian
44be154b04
Objective-C. Issue diagnostics on mismatched methods when their selector is used
...
in an @selector expression. // rdar://15794055
llvm-svn: 203693
2014-03-12 18:34:01 +00:00
Richard Smith
66204ecff9
DR1346: a parenthesized braced-init-list cannot be used as the initializer when
...
performing auto type deduction.
llvm-svn: 203683
2014-03-12 17:42:45 +00:00
Craig Topper
2b07f0252e
[C++11] Add 'override' keyword to virtual methods that override their base class.
...
llvm-svn: 203641
2014-03-12 05:09:18 +00:00
Craig Topper
e14c0f8e73
[C++11] Add 'override' keyword to virtual methods that override their base class.
...
llvm-svn: 203640
2014-03-12 04:55:44 +00:00
Ben Langmuir
dcf73861a5
Add an option -fmodules-validate-system-headers
...
When enabled, always validate the system headers when loading a module.
The end result of this is that when these headers change, we will notice
and rebuild the module.
llvm-svn: 203630
2014-03-12 00:06:17 +00:00
David Blaikie
29559b1efa
Driver: Support -gmlt as an alias for -gline-tables-only
...
llvm-svn: 203603
2014-03-11 21:05:26 +00:00
Fariborz Jahanian
bf678e82e1
Objective-C. Diagose use of undefined protocols
...
when a class adopts a protocol that inherits from
undefined protocols. // rdar://16111182
llvm-svn: 203586
2014-03-11 17:10:51 +00:00
Aaron Ballman
b5c59f5862
Gracefully handle an attribute specifier following a lambda introducer when the parameter list wasn't present.
...
llvm-svn: 203565
2014-03-11 13:03:15 +00:00
Tim Northover
c83472e0ff
Sema: demote invalid atomic ordering message to warning.
...
Someone could write:
if (0) {
__c11_atomic_load(ptr, memory_order_release);
}
or the equivalent, which is perfectly valid, so we shouldn't outright reject
invalid orderings on purely static grounds.
rdar://problem/16242991
llvm-svn: 203564
2014-03-11 11:35:10 +00:00
Tim Northover
e94a34cae2
Sema: produce error when invalid ordering is passed to atomic builtin
...
This is a conservative check, because it's valid for the expression to be
non-constant, and in cases like that we just don't know whether it's valid.
rdar://problem/16242991
llvm-svn: 203561
2014-03-11 10:49:14 +00:00
NAKAMURA Takumi
6c336fa5a7
clang::HeaderSearch: Use default constructor even for POD.
...
Unfortunately, msvc 2012 didn't accept non-static member initializer.
llvm-svn: 203554
2014-03-11 09:37:27 +00:00
Richard Smith
52e3fbaee8
Revert C++11ification in r203534 and r203536. Apparently our toolchains aren't
...
ready for this yet.
llvm-svn: 203548
2014-03-11 07:17:35 +00:00
Craig Topper
9140dd2fe7
[C++11] Add 'override' keyword to virtual methods that override their base class.
...
llvm-svn: 203547
2014-03-11 06:50:42 +00:00
Craig Topper
cbce6e9e63
[C++11] Add 'override' keyword to virtual methods that override their base class.
...
llvm-svn: 203543
2014-03-11 06:22:39 +00:00
Argyrios Kyrtzidis
34fad42003
[HeaderSearch] Fix issue where if a headermap entry maps the filename to a framework import (non-absolute path)
...
then we fail to find it if it is re-included later on.
rdar://16285490
llvm-svn: 203542
2014-03-11 06:21:28 +00:00
Craig Topper
3164f33f8f
[C++11] Add 'override' keyword to virtual methods that override their base class.
...
llvm-svn: 203537
2014-03-11 03:39:26 +00:00
Richard Smith
cf91493176
Speculative workaround for apparent libstdc++ bug exposed by r203534.
...
llvm-svn: 203536
2014-03-11 03:30:30 +00:00
Richard Trieu
99e1c9515a
Move the warning about unused relational comparison from -Wunused-value to
...
-Wunused-comparison. Also, newly warn on unused result from overloaded
relational comparisons, now also in -Wunused-comparison.
llvm-svn: 203535
2014-03-11 03:11:08 +00:00
Richard Smith
d91747980a
If a visibility update record is found for a DeclContext after that Decl has
...
already been loaded, apply that update record to the Decl immediately, rather
than adding it to a pending list and never applying it.
llvm-svn: 203534
2014-03-11 03:10:46 +00:00
Richard Smith
723928c7dc
If a module map is found in a relative -I path, convert the filenames within it
...
to absolute paths when building the includes file for the module. Without this,
the module build would fail, because the relative paths we were using are not
necessarily relative to a directory in our include path.
llvm-svn: 203528
2014-03-11 02:02:47 +00:00
David Majnemer
2f1f1818bf
Basic: Add -Wswitch-bool to control warn_bool_switch_condition
...
This warning was missing a flag, add one.
test/Misc/warning-flags.c has one fewer entry.
llvm-svn: 203522
2014-03-11 00:26:28 +00:00
Ben Langmuir
3fd7a63d67
Turn on the uncovered umbrella header warning by default
...
This warning (under -Wincomplete-umbrella) diagnoses cases that are
difficult to understand without the compiler's help, since the symptom
is likely to be that you are missing the contents of headers that are
mistakenly omitted from a module. This seems like a good thing to have
on by default (with the usual caveat for -Wsystem-headers).
llvm-svn: 203506
2014-03-10 22:34:23 +00:00
Benjamin Kramer
3f755aa7a8
[C++11] Avoid implicit conversion of ArrayRef to std::vector and use move semantics where appropriate.
...
llvm-svn: 203477
2014-03-10 17:55:02 +00:00
Aaron Ballman
be22bcb180
[C++11] Replacing DeclBase iterators specific_attr_begin() and specific_attr_end() with iterator_range specific_attrs(). Updating all of the usages of the iterators with range-based for loops.
...
llvm-svn: 203474
2014-03-10 17:08:28 +00:00
Samuel Benzaquen
a083935d0a
Add loc() to the dynamic registry.
...
Summary:
Add loc() to the dynamic registry.
Other fixes:
- Fix the polymorphic variant value to accept an exact match, even if
there are other possible conversions.
- Fix specifiesTypeLoc() to not crash on an empty
NestedNameSpecifierLoc.
Reviewers: klimek
CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D2928
llvm-svn: 203467
2014-03-10 15:40:23 +00:00
Aaron Ballman
53d413f794
[C++11] Replacing some using declarations which are not supported on all compilers (such as MSVC 2012) with a less problematic typedef.
...
llvm-svn: 203397
2014-03-09 12:59:45 +00:00
Ahmed Charles
dfca6f97bc
[C++11] Replace OwningPtr include with <memory>.
...
llvm-svn: 203389
2014-03-09 11:36:40 +00:00
Ahmed Charles
af94d56b56
[C++11] Remove the remaining uses of OwningPtr.
...
Replace OwningArrayPtr with std::unique_ptr<T[]>.
llvm-svn: 203388
2014-03-09 11:34:25 +00:00
Ted Kremenek
2dd810a331
[-Wunreachable-code] Handle Objective-C bool literals in 'isConfigurationValue'.
...
This includes special casing 'YES' and 'NO', which are constants
defined as macros.
llvm-svn: 203380
2014-03-09 08:13:49 +00:00
Argyrios Kyrtzidis
b255ee91a7
[libclang] Don't pad the main buffer for the preamble.
...
Padding does not seem to be useful currently, and it leads to bogus location if an error
points to the end of the file.
rdar://15836513
llvm-svn: 203370
2014-03-09 04:24:57 +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
23a6dcb365
[C++11] Replacing EnumDecl iterators enumerator_begin() and enumerator_end() with iterator_range enumerators(). Updating all of the usages of the iterators with range-based for loops.
...
llvm-svn: 203353
2014-03-08 18:45:14 +00:00
Aaron Ballman
43027eb093
Reapplying r203299 in a slightly different manner. Now range APIs are implemented in terms of iterator APIs.
...
llvm-svn: 203351
2014-03-08 18:30:40 +00:00
Ted Kremenek
fcc1417fad
Fix CFG bug where the 'isTemporaryDtorsBranch' bit was silently lost for terminators.
...
llvm-svn: 203335
2014-03-08 02:22:29 +00:00
Ismail Pazarbasi
025f428c73
Replace "can not" with "cannot" in diagnostics messages.
...
llvm-svn: 203302
2014-03-07 22:36:23 +00:00
Aaron Ballman
da634f1dee
In my tests, I'm finding that declaring iterators in terms of ranges can sometimes have dangerous side-effects where the range temporary is destroyed, taking the underlying iterators out with it.
...
This changes the iterators so that they are no longer implemented in terms of ranges (so it's a very partial revert of the existing rangification efforts).
llvm-svn: 203299
2014-03-07 22:17:20 +00:00
Ahmed Charles
b89843299a
Replace OwningPtr with std::unique_ptr.
...
This compiles cleanly with lldb/lld/clang-tools-extra/llvm.
llvm-svn: 203279
2014-03-07 20:03:18 +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
Ahmed Charles
d72a5f103d
Replace OwningPtr::isValid() with conversion to bool.
...
This is a precursor to moving to std::unique_ptr.
llvm-svn: 203277
2014-03-07 19:51:06 +00:00
Ahmed Charles
9a16beb8bc
Change OwningPtr::take() to OwningPtr::release().
...
This is a precursor to moving to std::unique_ptr.
llvm-svn: 203275
2014-03-07 19:33:25 +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
43b68bebe7
[C++11] Replacing ObjCMethodDecl 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: 203255
2014-03-07 17:50:17 +00:00
Aaron Ballman
e7fbde8cb6
[C++11] Adding an iterator_range accessor for parameter declarations to the CaptureDecl class; however, the only usage of the iterators cannot be converted to using the range yet. This change is for consistency with other Decls exposing parameters.
...
llvm-svn: 203252
2014-03-07 16:40:17 +00:00
Aaron Ballman
b2b8b1dc66
[C++11] Replacing BlockDecl 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: 203250
2014-03-07 16:09:59 +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
Benjamin Kramer
ed2f476b20
[C++11] Replace LLVM-style type traits with C++11 standard ones.
...
No functionality change.
llvm-svn: 203241
2014-03-07 14:30:23 +00:00