| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
| |
The patch is generated using this command:
$ tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \
-checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \
work/llvm/tools/clang
To reduce churn, not touching namespaces spanning less than 10 lines.
llvm-svn: 240270
|
|
|
|
|
|
| |
This fixes PR23801.
llvm-svn: 239503
|
|
|
|
|
|
|
|
| |
This is a follow-up to r225570 which enabled adding DLL attributes when a
class template goes from explicit instantiation declaration to explicit
instantiation definition.
llvm-svn: 239375
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
templates in some cases
It is safe to add a dll attribute if the base class template previously only had
an explicit instantiation declaration, or was implicitly instantiated.
I both those cases, the members would not have been codegenned yet. In the case
of explicit instantiation declaration this is natural, and for implicit
instantiations, codegen is deferred (see r225570).
This is work towards fixing PR23770.
llvm-svn: 239373
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Don't warn about not being able to propagate dll attribute to a base class template
when that base already has a different attribute.
MSVC doesn't actually try to do this; the first attribute that was propagated
takes precedence, so Clang is already doing the right thing and there's no
need to warn.
(This is a step towards fixing PR21718.)
llvm-svn: 239372
|
|
|
|
|
|
|
|
|
|
| |
definitions (PR23667)
Previously, we wouldn't call checkDLLAttribute() after the class template
specialization definition if the class template was already instantiated
by an explicit class template specialization declaration.
llvm-svn: 238266
|
|
|
|
|
|
|
|
|
|
| |
The method wasn't an overrider but didn't have 'virtual' textually
written because our CXXMethodDecl was an out-of-line definition. Make
sure we use the canonical decl instead.
This fixes PR23629.
llvm-svn: 237999
|
|
|
|
|
|
| |
an imported but hidden one.
llvm-svn: 237814
|
|
|
|
|
|
|
| |
We now use an enum which maps the marketing name (almost always a year)
to the major version number.
llvm-svn: 236967
|
|
|
|
|
|
|
| |
MSVC 2015 changed behavior from 2013; it imports move assignment
operators.
llvm-svn: 236966
|
|
|
|
|
|
| |
emitted as a memcpy.
llvm-svn: 236142
|
|
|
|
|
|
|
|
|
|
| |
For example, a function taking a parameter with internal linkage will
itself have internal linkage since it cannot be called outside the
translation unit.
Differential Revision: http://reviews.llvm.org/D9182
llvm-svn: 235471
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This affects this test case:
void foo();
template <typename T> class C {
friend inline void foo();
};
inline void foo() {}
C<int> c;
Here, we instantiate the foo friend decl and add it to foo's redecl
chain. However, our previous decl pointer happens to reference the first
declaration of foo, which is not marked inline. When we check to see if
foo was already defined, we implicitly search all previous decls. We
should do the same for the inline check, instead of just checking this
particular previous decl.
Reviewers: rsmith
Differential Revision: http://reviews.llvm.org/D8872
llvm-svn: 234374
|
|
|
|
|
|
|
| |
constructors, instead of having the typo-correction code also dispatch to the
inheriting constructor special case.
llvm-svn: 233833
|
|
|
|
|
|
|
|
| |
A parameter pack after a default argument is now valid.
PR23029.
llvm-svn: 233377
|
|
|
|
|
|
|
|
| |
This is ill-formed (and cannot be used anyways).
PR23028.
llvm-svn: 233376
|
|
|
|
|
|
| |
This was an omission from r232229.
llvm-svn: 232554
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
scope ends
Previously, we would error out on this code because the default argument
wasn't parsed until the end of Outer:
struct __declspec(dllexport) Outer {
struct __declspec(dllexport) Inner {
Inner(void *p = 0);
};
};
Now we do the checking on the closing brace of Outer instead of Inner.
llvm-svn: 232519
|
|
|
|
|
|
|
|
|
|
|
|
| |
Using declarations which are aliases to struct types have their name
used as the struct type's name for linkage purposes. Otherwise, make
sure to give an anonymous struct defined inside a using declaration a
mangling number to disambiguate it from other anonymous structs in the
same context.
This fixes PR22809.
llvm-svn: 231909
|
|
|
|
| |
llvm-svn: 231573
|
|
|
|
|
|
|
|
| |
The exception object should be unqualified. Using a qualified exception
object results in the wrong copy constructor getting called when the
catch handler executes.
llvm-svn: 231054
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
dynamic classes in the translation unit and check whether each one's key
function is defined when we got to the end of the TU (and when we got to the
end of each module). This is really terrible for modules performance, since it
causes unnecessary deserialization of every dynamic class in every compilation.
We now use a much simpler (and, in a modules build, vastly more efficient)
system: when we see an out-of-line definition of a virtual function, we check
whether that function was in fact its class's key function. (If so, we need to
emit the vtable.)
llvm-svn: 230830
|
|
|
|
|
|
|
| |
bug is not actually modules-specific, but it's a little tricky to tickle it
outside of modules builds, so submitting with the reduced testcase I have.
llvm-svn: 230303
|
|
|
|
|
|
|
| |
results. No-one was ever modifying a lookup result, and it would not be
reasonable to do so.
llvm-svn: 230123
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
dllexport (PR22591)
This is only a problem in C++03 mode targeting MS ABI (MinGW doesn't
export inline methods, and C++11 marks these methods implicitly
deleted).
Since targeting the MS ABI in pre-C++11 mode is a rare configuration,
this will probably not get fixed, but we can at least have a better
error message.
llvm-svn: 230115
|
|
|
|
|
|
|
|
|
| |
MinGW neither imports nor exports such methods. The import bit was
committed earlier, in r221154, and this takes care of the export part.
This also partially fixes PR22591.
llvm-svn: 229922
|
|
|
|
|
|
|
|
|
|
|
|
| |
Sema::MergeCXXFunctionDecl: propagate hasUnparsedDefaultArg to new decl.
Parser::HandleMemberFunctionDeclDelays: check hasUnparsedDefaultArg
flag.
Parser::ParseLexedMethodDeclaration: handle inherited unparsed default
arg case.
llvm-svn: 229852
|
|
|
|
|
|
| |
requiring the macro. NFC; Clang edition.
llvm-svn: 229339
|
|
|
|
|
|
|
| |
Parser::ParseLexedMethodDeclaration: Use local var for Param
Sema::MergeCXXFunctionDecls: Use hasInheritedDefaultArg
llvm-svn: 227577
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
clang currently calls MarkVTableUsed() for classes that get their virtual
methods called or that participate in a dynamic_cast. This is unnecessary,
since CodeGen only emits vtables when it generates constructor, destructor, and
vtt code. (*)
Note that Sema::MarkVTableUsed() doesn't cause the emission of a vtable.
Its main user-visible effect is that it instantiates virtual member functions
of template classes, to make sure that if codegen decides to write a vtable
all the entries in the vtable are defined.
While this shouldn't change the behavior of codegen (other than being faster),
it does make clang more permissive: virtual methods of templates (in particular
destructors) end up being instantiated less often. In particular, classes that
have members that are smart pointers to incomplete types will now get their
implicit virtual destructor instantiated less frequently. For example, this
used to not compile but does now compile:
template <typename T> struct OwnPtr {
~OwnPtr() { static_assert((sizeof(T) > 0), "TypeMustBeComplete"); }
};
class ScriptLoader;
struct Base { virtual ~Base(); };
struct Sub : public Base {
virtual void someFun() const {}
OwnPtr<ScriptLoader> m_loader;
};
void f(Sub *s) { s->someFun(); }
The more permissive behavior matches both gcc (where this is not often
observable, since in practice most things with virtual methods have a key
function, and Sema::DefineUsedVTables() skips vtables for classes with key
functions) and cl (which is my motivation for this change) – this fixes
PR20337. See this issue and the review thread for some discussions about
optimizations.
This is similar to r213109 in spirit. r225761 was a prerequisite for this
change.
Various tests relied on "a->f()" marking a's vtable as used (in the sema
sense), switch these to just construct a on the stack. This forces
instantiation of the implicit constructor, which will mark the vtable as used.
(*) The exception is -fapple-kext mode: In this mode, qualified calls to
virtual functions (`a->Base::f()`) still go through the vtable, and since the
vtable pointer off this doesn't point to Base's vtable, this needs to reference
Base's vtable directly. To keep this working, keep referencing the vtable for
virtual calls in apple kext mode.
llvm-svn: 227073
|
|
|
|
| |
llvm-svn: 226441
|
|
|
|
|
|
| |
Warn on inaccessible direct base
llvm-svn: 226423
|
|
|
|
| |
llvm-svn: 226320
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(PR22035)
Clang would previously become confused and crash here.
It does not make a lot of sense to export these, so warning seems appropriate.
MSVC will export some member functions for this kind of specializations, whereas
MinGW ignores the dllexport-edness. The latter behaviour seems better.
Differential Revision: http://reviews.llvm.org/D6984
llvm-svn: 226208
|
|
|
|
|
|
|
|
|
|
|
| |
Sema calls HandleVTable() with a bool parameter which is then threaded through
three layers. The only effect of this bool is an early return at the last
layer.
Instead, remove this parameter and call HandleVTable() only if the bool is
true. No intended behavior change.
llvm-svn: 226096
|
|
|
|
|
|
|
|
| |
We'd crash trying to make the SourceRange for the tokens we'd like to
highlight. Don't assume there is more than one token makes up the
default argument.
llvm-svn: 225774
|
|
|
|
| |
llvm-svn: 225324
|
|
|
|
|
|
|
| |
We correctly forbid variables but not variable templates. Diagnose this
case instead of crashing.
llvm-svn: 224905
|
|
|
|
|
|
| |
declared return type (including a trailing-return-type in C++14).
llvm-svn: 224561
|
|
|
|
|
|
|
|
|
| |
This code was written with the intent that a pointer could be null but
we dyn_cast'd it anyway. Change the dyn_cast to a dyn_cast_or_null.
This fixes PR21933.
llvm-svn: 224411
|
|
|
|
|
|
| |
type.
llvm-svn: 224388
|
|
|
|
|
|
|
|
| |
Update the comments to make it more clear what's going on, and address
Richard's comments from PR21718. This doesn't fix that bug, but hopefully
makes the code easier to understand.
llvm-svn: 224303
|
|
|
|
|
|
|
|
|
| |
We would crash trying to treat a property member as a field. These
shoudl be forbidden anyway, reject programs which contain them.
This fixes PR21840.
llvm-svn: 224193
|
|
|
|
|
|
|
| |
Includes a new test case since none of the existing tests were hitting
this code path.
llvm-svn: 223705
|
|
|
|
|
|
| |
other function named "move".
llvm-svn: 222863
|
|
|
|
| |
llvm-svn: 222666
|
|
|
|
|
|
| |
specification has not yet been parsed.
llvm-svn: 222603
|
|
|
|
|
|
| |
constructor.
llvm-svn: 222503
|
|
|
|
|
|
| |
pair<iterator, bool> as per the C++ standard's associative container concept.
llvm-svn: 222335
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Specifically, when we have this situation:
struct A {
template <typename T> struct B {
int m1 = sizeof(A);
};
B<int> m2;
};
We can't parse m1's initializer eagerly because we need A to be
complete. Therefore we wait until the end of A's class scope to parse
it. However, we can trigger instantiation of B before the end of A,
which will attempt to instantiate the field decls eagerly, and it would
build a bad field decl instantiation that said it had an initializer but
actually lacked one.
Fixed by deferring instantiation of default member initializers until
they are needed during constructor analysis. This addresses a long
standing FIXME in the code.
Fixes PR19195.
Reviewed By: rsmith
Differential Revision: http://reviews.llvm.org/D5690
llvm-svn: 222192
|