| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
| |
(I was going to fix the TODO about DenseMap too, but
that would break self-host right now. See PR11922.)
llvm-svn: 149799
|
|
|
|
|
|
|
|
| |
include.
Fix all the transitive include users.
llvm-svn: 149783
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
value of class type, look for a unique conversion operator converting to
integral or unscoped enumeration type and use that. Implements [expr.const]p5.
Sema::VerifyIntegerConstantExpression now performs the conversion and returns
the converted result. Some important callers of Expr::isIntegralConstantExpr
have been switched over to using it (including all of those required for C++11
conformance); this switch brings a side-benefit of improved diagnostics and, in
several cases, simpler code. However, some language extensions and attributes
have not been moved across and will not perform implicit conversions on
constant expressions of literal class type where an ICE is required.
In passing, fix static_assert to perform a contextual conversion to bool on its
argument.
llvm-svn: 149776
|
|
|
|
| |
llvm-svn: 149770
|
|
|
|
|
|
| |
Also, in C, call this a C11 extension rather than a GNU extension.
llvm-svn: 149695
|
|
|
|
|
|
| |
C++11 rules.
llvm-svn: 149641
|
|
|
|
|
|
| |
is declaring ivars. // rdar://10752081
llvm-svn: 149573
|
|
|
|
|
|
| |
Fixes PR11847. Patch from Jason Haslam!
llvm-svn: 149460
|
|
|
|
| |
llvm-svn: 149451
|
|
|
|
| |
llvm-svn: 149127
|
|
|
|
| |
llvm-svn: 149124
|
|
|
|
|
|
| |
Builtins.
llvm-svn: 148873
|
|
|
|
| |
llvm-svn: 148850
|
|
|
|
|
|
|
|
| |
Fix some review comments.
Add a test for deduction when std::initializer_list isn't available yet.
Fix redundant error messages. This fixes and outstanding FIXME too.
llvm-svn: 148735
|
|
|
|
|
|
| |
enumerator that were introduced with r148439. Otherwise MSVC headers won't compile in C++ 11 mode.
llvm-svn: 148642
|
|
|
|
| |
llvm-svn: 148592
|
|
|
|
|
|
|
|
|
|
| |
values and non-type template arguments of integral and enumeration types.
This change causes some legal C++98 code to no longer compile in C++11 mode, by
enforcing the C++11 rule that narrowing integral conversions are not permitted
in the final implicit conversion sequence for the above cases.
llvm-svn: 148439
|
|
|
|
|
|
|
|
|
|
|
|
| |
Includes tests highlighting the cases where accuracy has improved
(there is one call that does no filtering beyond selecting the set
of allowed keywords, and one call that only triggers for ObjC code
for which a test by someone who knows ObjC would be welcome). Also
fixes a small typo in one of the suggestion messages, and drops a
malformed "expected-note" for a suggestion that did not occur even
when the malformed note was committed as r145930.
llvm-svn: 148420
|
|
|
|
|
|
|
|
| |
support. This means you can now write:
for (int i : {1, 4, 512, 23, 251}) {}
llvm-svn: 148353
|
|
|
|
|
|
|
|
| |
objc class was not being exported to parent decl
context resulting in bogus mismatch warning later on.
// rdar://10655530
llvm-svn: 148320
|
|
|
|
|
|
| |
This allows -Wswitch-enum to find switches that need updating when these enums are modified.
llvm-svn: 148281
|
|
|
|
|
|
|
|
|
|
|
|
| |
we have a redeclarable type, and only use the new virtual versions
(getPreviousDeclImpl() and getMostRecentDeclImpl()) when we don't have
that type information. This keeps us from penalizing users with strict
type information (and is the moral equivalent of a "final" method).
Plus, settle on the names getPreviousDecl() and getMostRecentDecl()
throughout.
llvm-svn: 148187
|
|
|
|
|
|
|
|
| |
don't set isUsed for local variables which are referenced in unevaluated contexts. Make other code use isReferenced() (which basically indicates that a declaration isn't dead) where appropriate.
I was forced to change test/SemaCXX/linkage.cpp because we aren't actually modeling extern "C" in the AST the way that testcase expects; we were not printing a warning only because we skipped the relevant check. Someone who actually understands the semantics here should fix that.
llvm-svn: 148158
|
|
|
|
|
|
| |
incomplete return type.
llvm-svn: 148088
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- If the declarator is at the start of a line, and the previous line contained
another declarator and ended with a comma, then that comma was probably a
typo for a semicolon:
int n = 0, m = 1, l = 2, // k = 5;
myImportantFunctionCall(); // oops!
- If removing the parentheses would correctly initialize the object, then
produce a note suggesting that fix.
- Otherwise, if there is a simple initializer we can suggest which performs
value-initialization, then provide a note suggesting a correction to that
initializer.
Sema::Declarator now tracks the location of the comma prior to the declarator in
the declaration, if there is one, to facilitate providing the note. The code to
determine an appropriate initializer from the -Wuninitialized warning has been
factored out to allow use in both that and -Wvexing-parse.
llvm-svn: 148072
|
|
|
|
|
|
|
| |
in class extensions and categories by recent refactoring
of objc class ASTs. // rdar://1066654
llvm-svn: 147982
|
|
|
|
|
|
| |
variably-modified type.
llvm-svn: 147973
|
|
|
|
|
|
|
| |
downgrade the default-error warning to an ExtWarn in
C90/99. <rdar://problem/10668057>
llvm-svn: 147925
|
|
|
|
|
|
|
|
| |
- reject definitions of enums within friend declarations
- require 'enum', not 'enum class', for non-declaring references to scoped
enumerations
llvm-svn: 147824
|
|
|
|
| |
llvm-svn: 147812
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
is important because it's fairly common for headers (especially system
headers) to want to provide only those typedefs needed for that
particular header, based on some guard macro, e.g.,
#ifndef _SIZE_T
#define _SIZE_T
typedef long size_t;
#endif
which is repeated in a number of headers. The guard macro protects
against duplicate definitions. However, this means that only the first
occurrence of this pattern actually defines size_t, so the submodule
corresponding to this header has the only visible definition. If a
user then imports a different submodule from the same module, size_t
will be known but not visible, and therefore cannot be used.
By allowing redefinition of typedefs, each header that wants to define
size_t can do so independently, so it will be available in the
corresponding submodules.
llvm-svn: 147775
|
|
|
|
| |
llvm-svn: 147774
|
|
|
|
| |
llvm-svn: 147730
|
|
|
|
|
|
|
| |
call is elidable or if the constructor is trivial instead of checking if it
is user declared.
llvm-svn: 147652
|
|
|
|
|
|
|
|
| |
int f();
in function scopes under -Wvexing-parse, so now we do.
llvm-svn: 147649
|
|
|
|
|
|
|
| |
the Semantic Powers to only warn on class types (or dependent types), where the
constructor or destructor could do something interesting.
llvm-svn: 147642
|
|
|
|
|
|
| |
pieces to build the lambda class and its call operator. Create an actual scope for the lambda body.
llvm-svn: 147595
|
|
|
|
| |
llvm-svn: 147575
|
|
|
|
|
|
|
|
|
|
|
|
| |
the AST reader doesn't actually perform a merge, because name lookup
knows how to merge identical typedefs together.
As part of this, teach C/Objective-C name lookup to return multiple
results in all cases, rather than first digging through the attributes
to see if the value is overloadable. This way, we'll catch ambiguous
lookups in C/Objective-C.
llvm-svn: 147498
|
|
|
|
|
|
| |
@import identifier [. identifier]* ;
llvm-svn: 147452
|
|
|
|
|
|
|
| |
forward declarations and definitions of an Objective-C protocol are
represented within a single chain of ObjCProtocolDecls.
llvm-svn: 147412
|
|
|
|
| |
llvm-svn: 147407
|
|
|
|
| |
llvm-svn: 147281
|
|
|
|
|
|
|
| |
longer have access to the source locations we need to produce the
'replace constexpr with const' fixits, so they're gone for now.
llvm-svn: 147273
|
|
|
|
| |
llvm-svn: 147260
|
|
|
|
|
|
|
|
| |
- constexpr function template instantiations
- variables of reference type
- constexpr variables
llvm-svn: 147031
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
visibility restrictions. This ensures that all declarations of the
same entity end up in the same redeclaration chain, even if some of
those declarations aren't visible. While this may seem unfortunate to
some---why can't two C modules have different functions named
'f'?---it's an acknowedgment that a module does not introduce a new
"namespace" of names.
As part of this, stop merging the 'module-private' bit from previous
declarations to later declarations, because we want each declaration
in a module to stand on its own because this can effect, for example,
submodule visibility.
Note that this notion of names that are invisible to normal name
lookup but are available for redeclaration lookups is how we should
implement friend declarations and extern declarations within local
function scopes. I'm not tackling that problem now.
llvm-svn: 146980
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
variable is initialized by a non-constant expression, and pass in the variable
being declared so that earlier-initialized fields' values can be used.
Rearrange VarDecl init evaluation to make this possible, and in so doing fix a
long-standing issue in our C++ constant expression handling, where we would
mishandle cases like:
extern const int a;
const int n = a;
const int a = 5;
int arr[n];
Here, n is not initialized by a constant expression, so can't be used in an ICE,
even though the initialization expression would be an ICE if it appeared later
in the TU. This requires computing whether the initializer is an ICE eagerly,
and saving that information in PCH files.
llvm-svn: 146856
|
|
|
|
|
|
| |
declarations without a declarator to structs. Add a warning for ignored attributes. Patch by Michael Han.
llvm-svn: 146796
|
|
|
|
|
|
|
|
| |
applies to an actual definition. Plus, clarify the purpose of this
field and give the accessor a different name, since getLocEnd() is
supposed to be the same as getSourceRange().getEnd().
llvm-svn: 146694
|