| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
| |
C++ [basic.start.main]p1: "It shall have a return type of type int"
ISO C is also clear about this, so only accept 'int' with qualifiers in GNUMode
C.
llvm-svn: 212171
|
|
|
|
|
|
|
|
|
|
| |
This source range is useful for all kinds of diagnostic QOI and refactoring
work, so let's make it more discoverable.
This commit also makes use of the new function to enhance various diagnostics
relating to return types and resolves an old FIXME.
llvm-svn: 212154
|
|
|
|
| |
llvm-svn: 211988
|
|
|
|
|
|
|
|
|
|
|
|
| |
Types defined in function prototype are diagnosed earlier in C++ compilation.
They are put into declaration context where the prototype is introduced. Later on,
when FunctionDecl object is created, these types are moved into the function context.
This patch fixes PR19018 and PR18963.
Differential Revision: http://reviews.llvm.org/D4145
llvm-svn: 211718
|
|
|
|
|
|
| |
implements C++ Issue 1940.
llvm-svn: 211606
|
|
|
|
|
|
|
|
|
|
|
|
| |
super-terse notation
for (x : range) { ... }
which is equivalent to
for (auto &&x : range) { ... }
llvm-svn: 211267
|
|
|
|
|
|
|
|
| |
Make it return void and delete the dead code in the parser that handled
the case where it might return false. This has been dead since 2010
when John deleted Action.h.
llvm-svn: 211248
|
|
|
|
|
|
|
|
|
|
|
| |
CL permits static redeclarations to follow extern declarations. The
storage specifier on the latter declaration has no effect.
This fixes PR20034.
Differential Revision: http://reviews.llvm.org/D4149
llvm-svn: 211238
|
|
|
|
|
|
|
|
| |
This makes us handle static locals in exported/imported functions correctly.
Differential Revision: http://reviews.llvm.org/D4136
llvm-svn: 211173
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The compilation pipeline doesn't actually need to know about the high-level
concept of diagnostic mappings, and hiding the final computed level presents
several simplifications and other potential benefits.
The only exceptions are opportunistic checks to see whether expensive code
paths can be avoided for diagnostics that are guaranteed to be ignored at a
certain SourceLocation.
This commit formalizes that invariant by introducing and using
DiagnosticsEngine::isIgnored() in place of individual level checks throughout
lex, parse and sema.
llvm-svn: 211005
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
'sizeof' is a UnaryExprOrTypeTrait, and it can contain either a type or
an expression. This change threads a RecoveryTSI parameter through the
layers between TransformUnaryExprOrTypeTrait the point at which we look
up the type. If lookup finds a single type result after instantiation,
we now build TypeSourceInfo for it just like a normal transformation
would.
This fixes the last error in the hello world ATL app that I've been
working with, and it now links and runs with clang. Please try it and
file bugs!
Reviewers: rsmith
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D4108
llvm-svn: 210855
|
|
|
|
|
|
| |
This expands the logic from r210141 to cover partial specializations too.
llvm-svn: 210484
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
MSVC delays parsing of default arguments until instantiation. If the
default argument is never used, it is never parsed. We don't model
this.
Instead, if lookup of a type name fails in a template argument context,
we form a DependentNameType, which will be looked up at instantiation
time.
This fixes errors about 'CControlWinTraits' in atlwin.h.
Reviewers: rsmith
Differential Revision: http://reviews.llvm.org/D3995
llvm-svn: 210382
|
|
|
|
|
|
|
|
|
|
| |
This patch adds support for pointer types in global named registers variables.
It'll be lowered as a pair of read/write_register and inttoptr/ptrtoint calls.
Also adds some early checks on types on SemaDecl to avoid the assert.
Tests changed accordingly. (PR19837)
llvm-svn: 210274
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
templates (PR19902)
This allows us to compile the following kind of code, which occurs in MSVC
headers:
template <typename> struct S {
__declspec(dllimport) static int x;
};
template <typename T> int S<T>::x;
The definition works similarly to a dllimport inline function definition and
gets available_externally linkage.
Differential Revision: http://reviews.llvm.org/D3998
llvm-svn: 210141
|
|
|
|
|
|
|
| |
Redeclarations cannot add a dll attribute and static data members cannot
be defined.
llvm-svn: 209825
|
|
|
|
| |
llvm-svn: 209812
|
|
|
|
|
|
| |
takeAs to getAs.
llvm-svn: 209800
|
|
|
|
|
|
|
| |
in Objective-C container declarations (but not
in their definitions. // rdar://10414277
llvm-svn: 209751
|
|
|
|
|
|
| |
of supporting it as a "extension" (which serves no purpose). Un-XFAILing the test for mutable specifiers.
llvm-svn: 209635
|
|
|
|
| |
llvm-svn: 209613
|
|
|
|
| |
llvm-svn: 209596
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PR11170)
The previous code that was supposed to handle this didn't work
since parsing of inline method definitions is delayed to the end
of the outer class definition. Thus, when HandleTagDeclDefinition()
got called for the inner class, the inline functions in that class
had not been parsed yet.
Richard suggested that the way to do this is by handling inline
method definitions through a new ASTConsumer callback.
I really wanted to call ASTContext::DeclMustBeEmitted() instead of
checking for attributes, but doing that causes us to compute linkage,
and then we fail with "error: unsupported: typedef changes linkage
of anonymous type, but linkage was already computed" on tests like
this: (from SemaCXX/undefined-internal.cpp) :-/
namespace test7 {
typedef struct {
void bar();
void foo() { bar(); }
} A;
}
Differential Revision: http://reviews.llvm.org/D3809
llvm-svn: 209549
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
'optnone'.
This patch implements support for selectively disabling optimizations on a
range of function definitions through a pragma. The implementation is that
all function definitions in the range are decorated with attribute
'optnone'.
#pragma clang optimize off
// All function definitions in here are decorated with 'optnone'.
#pragma clang optimize on
// Compilation resumes as normal.
llvm-svn: 209510
|
|
|
|
| |
llvm-svn: 209466
|
|
|
|
| |
llvm-svn: 209449
|
|
|
|
|
|
|
| |
If we're so keen on saving a dynamic allocation to add the trailing space, we
might as well do it in style.
llvm-svn: 209247
|
|
|
|
| |
llvm-svn: 209157
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch implements global named registers in Clang, lowering to the just
created intrinsics in LLVM (@llvm.read/write_register). A new type of LValue
had to be created (Register), which just adds support to carry the metadata
node containing the name of the register. Two new methods to emit loads and
stores interoperate with another to emit the named metadata node.
No guarantees are being made and only non-allocatable global variable named
registers are being supported. Local named register support is unchanged.
llvm-svn: 209149
|
|
|
|
|
|
|
|
| |
This is a step towards handling these attributes on classes (PR11170).
Differential Revision: http://reviews.llvm.org/D3772
llvm-svn: 208925
|
|
|
|
|
|
|
| |
elaborated-type-specifier, place it in the correct
context.
llvm-svn: 208799
|
|
|
|
|
|
|
|
|
| |
resolves to an existing declaration if there are attributes
present.
This gives us something to apply the attributes to.
llvm-svn: 208756
|
|
|
|
|
|
| |
implied by 'constexpr'.
llvm-svn: 208511
|
|
|
|
|
|
|
|
| |
Also correct argument/parameter terminology.
No change in functionality.
llvm-svn: 208498
|
|
|
|
|
|
|
|
|
|
| |
This lets us diagnose and perform more complete semantic analysis when faced
with errors in the function body or declaration.
By recovering here we provide more consistent diagnostics, particularly during
interactive editing.
llvm-svn: 208394
|
|
|
|
|
|
|
| |
whether the definition of the template is visible rather than checking whether
the instantiated definition happens to be in an imported module.
llvm-svn: 208150
|
|
|
|
|
|
|
|
| |
Ideally, importing Foo.a from Foo.b would "do the right thing", but
until it does, this patch makes it an error rather than allow it to
silently be ignored.
llvm-svn: 207948
|
|
|
|
|
|
|
|
|
|
| |
* Fixes a "return" that was indented at the same level as the continuation
from the previous line
* Wrap several lines to 80 columns
* Remove an if check that was always true
* Move a variable declaration slightly closer to its use
llvm-svn: 207922
|
|
|
|
| |
llvm-svn: 207896
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
We were emitting dynamic initializers for __thread variables if there
was no explicit initializer, as in this test case:
struct S { S(); };
__thread S s;
llvm-svn: 207675
|
|
|
|
|
|
|
|
| |
Patch by Dinesh Dwivedi!
Differential Revision: http://reviews.llvm.org/D3376
llvm-svn: 207672
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
A reference temporary should inherit the linkage of the variable it
initializes. Otherwise, we may hit cases where a reference temporary
wouldn't have the same value in all translation units.
Reviewers: rsmith
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D3515
llvm-svn: 207451
|
|
|
|
|
|
| |
partial specialization.
llvm-svn: 207260
|
|
|
|
|
|
| |
symbols in non-imported modules.
llvm-svn: 206977
|
|
|
|
|
|
| |
const-correct. No functional changes intended.
llvm-svn: 206491
|
|
|
|
|
|
| |
template-id after its scope specifier into a single place.
llvm-svn: 206442
|
|
|
|
|
|
|
| |
we'll already have issued the relevant diagnostic when we saw the declaration
of the primary template.
llvm-svn: 206441
|
|
|
|
|
|
|
|
| |
subclasses do not call [super init] on their initializers.
Part of rdar://16568441
llvm-svn: 206410
|
|
|
|
| |
llvm-svn: 206298
|