| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
With -fms-extensions it is possible to have a non-class record that is a
template specialization cause an assertion failure via the call to
Type::getAsCXXRecordDecl. Fixes PR 24246.
llvm-svn: 249090
|
| |
|
|
|
|
|
| |
Such declarations would be invalid anyway, and trying to make the
correction will lead to a crash. Fixes PR 24781.
llvm-svn: 248928
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
specification) to an error. No compiler other than Clang seems to allow this,
and it doesn't seem like a useful thing to accept as an extension in general.
The current behavior was added for PR5957, where the problem was specifically
related to mismatches of the exception specification on the implicitly-declared
global operator new and delete. To retain that workaround, we downgrade the
error to an ExtWarn when the declaration is of a replaceable global allocation
function.
Now that this is an error, stop trying (and failing) to recover from a missing
computed noexcept specification. That recovery didn't work, and led to crashes
in code like the added testcase.
llvm-svn: 248867
|
| |
|
|
| |
llvm-svn: 248805
|
| |
|
|
|
|
| |
variables as well member variables.
llvm-svn: 248803
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This patch fixes the order in which we evaluate the different ways that
a function call could be disallowed. Now, if you call a non-overloaded
function with an incomplete type and failing enable_if, we'll prioritize
reporting the more obvious error (use of incomplete type) over reporting
the failing enable_if.
Thanks to Ettore Speziale for the patch!
llvm-svn: 248595
|
| |
|
|
|
|
|
|
|
|
| |
someone thought all the bits would be value bits in this case.
Also fix the wording of the warning -- it claimed that the width of 'bool' is
8, which is not correct; the width is 1 bit, whereas the size is 8 bits in our
implementation.
llvm-svn: 248435
|
| |
|
|
|
|
|
|
|
| |
We took both source locations from the end of the initializer list what
the code below doesn't expect. This can lead to a crash when rendering
the diagnostic (PR24816). Assert that we have more than one element in
a scalar initializer with too many elements.
llvm-svn: 248391
|
| |
|
|
|
|
| |
Fixes PR24872.
llvm-svn: 248376
|
| |
|
|
| |
llvm-svn: 247966
|
| |
|
|
|
|
|
| |
This is to follow up on David's comment in
http://reviews.llvm.org/D12422#235509
llvm-svn: 247718
|
| |
|
|
|
|
| |
This restores a diagnostic lost in r247651.
llvm-svn: 247659
|
| |
|
|
|
|
|
|
| |
Overwide bool bitfields have eight bits of storage size, make sure we
take the padding into account when determining whether or not they are
problematic.
llvm-svn: 247651
|
| |
|
|
|
|
|
|
|
|
| |
MS compiler ignores calling convention modifiers for structors. This patch makes
clang do the same (for MS ABI). This fixes PR24595 and makes vswriter.h header
(from Windows SDK 8.1) compilable.
Differential Revision: http://reviews.llvm.org/D12402
llvm-svn: 247619
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Summary: Implement DR262 (for C). This patch will mainly affect bitfields of type _Bool
Reviewers: fraggamuffin, rsmith
Subscribers: hubert.reinterpretcast, cfe-commits
Differential Revision: http://reviews.llvm.org/D10018
llvm-svn: 247618
|
| |
|
|
|
|
|
|
|
| |
T in the expression T() must be a non-array complete object type or
the void type. Function types are neither.
This fixes PR24798.
llvm-svn: 247535
|
| |
|
|
|
|
| |
rdar://22464808
llvm-svn: 247207
|
| |
|
|
|
|
|
|
| |
They might technically have external linkage, but it still doesn't make sense
for the user to try and export such variables. This matches MSVC's and MinGW's
behaviour.
llvm-svn: 246864
|
| |
|
|
|
|
| |
breakage.
llvm-svn: 246850
|
| |
|
|
|
|
| |
for targeting i686-(msvc|mingw32).
llvm-svn: 246849
|
| |
|
|
|
|
| |
has a destructor
llvm-svn: 246844
|
| |
|
|
|
|
|
| |
disable checking of arguments to the function, which is done by
-Wthread-safety-reference.
llvm-svn: 246806
|
| |
|
|
|
|
|
|
| |
constructor or destructor function-try-block, which is UB in C++.
This corresponds to the CERT secure coding rule ERR53-CPP.
llvm-svn: 246548
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
functions when safe (PR24593)
This patch does two things:
1) Don't error about dllimport/export on thread-local static local variables.
We put those attributes on static locals in dllimport/export functions
implicitly in case the function gets inlined. Now, for TLS variables this
is a problem because we can't import such variables, but it's a benign
problem becase:
2) Make sure we never inline a dllimport function TLS static locals. In fact,
never inline a dllimport function that references a non-imported function
or variable (because these are not defined in the importing library). This
seems to match MSVC's behaviour.
Differential Revision: http://reviews.llvm.org/D12422
llvm-svn: 246338
|
| |
|
|
|
|
| |
pointer to an RVO construction of a returned object.
llvm-svn: 246263
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now we can parse code like this:
struct A {
int field;
};
int f(A o) {
__asm mov eax, o.field
}
Fixes PR19117.
llvm-svn: 246088
|
| |
|
|
|
|
|
|
|
|
| |
We tried to provide a very nice diagnostic when diagnosing an assignment
to a const int & produced by a function call. However, we cannot always
determine what function was called.
This fixes PR24568.
llvm-svn: 246014
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
SourceRange
Summary:
- Store the exception specification range's begin and end SourceLocation in DeclaratorChuck::FunctionTypeInfo. These SourceLocations can be used in a FixItHint Range.
- Add diagnostic; function concept having an exception specification.
Reviewers: hubert.reinterpretcast, fraggamuffin, faisalv, aaron.ballman, rsmith
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D11789
llvm-svn: 246005
|
| |
|
|
|
|
| |
overloads. Patch by Ettore Speziale!
llvm-svn: 245985
|
| |
|
|
|
|
| |
because the returned value does not match the function return type.
llvm-svn: 245979
|
| |
|
|
|
|
|
|
|
|
| |
GNU attributes can have a leading and trailing __ appended/prepended to
the attribute name. While the parser and AttributeList::getKind did the
right thing, AttributeList::getAttributeSpellingListIndex did not.
This fixes PR24565.
llvm-svn: 245953
|
| |
|
|
|
|
|
|
|
|
|
|
| |
While working around a bug in certain standard library implementations,
we would try to diagnose the issue so that library implementors would
fix their code. However, we assumed an entity being initialized was
a non-static data member subobject when other circumstances are
possible.
This fixes PR24526.
llvm-svn: 245675
|
| |
|
|
|
|
| |
Capture line numbers in a variable for FileCheck instead of hardcoding them.
llvm-svn: 245250
|
| |
|
|
|
|
| |
Discussed with Richard Smith.
llvm-svn: 245162
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Summary: Adding check to emit diagnostic for invalid tag when concept is specified and associated tests.
Reviewers: rsmith, hubert.reinterpretcast, fraggamuffin, faisalv, aaron.ballman
Subscribers: aaron.ballman, cfe-commits
Differential Revision: http://reviews.llvm.org/D11916
llvm-svn: 245123
|
| |
|
|
|
|
|
|
| |
This non-conforming extension was introduced to make it possible for us
to correctly compile <atomic> in VS 2013 and 2015. Let's limit its
impact to system headers to encourage portable code.
llvm-svn: 244650
|
| |
|
|
|
|
|
|
| |
Our implementations of these type trait intrinsics simply mapped them to
__has_trivial_destructor. Instead, flesh these intrinsics out with a
full implementation which matches the standard's description.
llvm-svn: 244564
|
| |
|
|
|
|
| |
being instantiated, and that instantiation fails, fail our instantiation instead of crashing. Errors have already been emitted.
llvm-svn: 244515
|
| |
|
|
|
|
|
|
|
| |
It's not valid code (maybe it can be made valid, but I'm not sure how).
To trigger the crash fixed in r243987 requires a friend function with
more than four template parameter lists. With this test we have at least
some coverage.
llvm-svn: 243989
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
concept
Summary: Add IsConcept bit to VarDecl::NonParmVarDeclBitfields and associated isConcept/setConcept member functions. Set IsConcept to true when 'concept' specifier is in variable declaration. Create diagnostic when variable concept is not initialized.
Reviewers: fraggamuffin, hubert.reinterpretcast, faisalv, aaron.ballman, rsmith
Subscribers: aemerson, cfe-commits
Differential Revision: http://reviews.llvm.org/D11600
llvm-svn: 243876
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Adding diagnostic for concepts declared as non template (function
or variable)
Reviewers: faisalv, fraggamuffin, rsmith, hubert.reinterpretcast
Subscribers: nwilson, cfe-commits
Differential Revision: http://reviews.llvm.org/D11490
Patch by Nathan Wilson!
llvm-svn: 243690
|
| |
|
|
|
|
|
|
|
| |
Without DR1579 implemented, the only case for -Wredundant-move is for a
parameter being returned with the same type as the function return type. Also
include a check to verify that the move constructor will be used by matching
nodes in the AST dump.
llvm-svn: 243594
|
| |
|
|
|
|
|
|
|
| |
Dependent types can throw off the analysis for these warnings, possibly giving
conflicting warnings and fix-its. Disabling the warning in template
instantiations will prevent this problem, and will still catch the
non-dependent cases in templates.
llvm-svn: 243538
|
| |
|
|
|
|
|
|
|
| |
error.
If the object being moved has a move constructor and a deleted copy constructor,
std::move is required, otherwise Clang will give a deleted constructor error.
llvm-svn: 243463
|
| |
|
|
|
|
|
|
|
| |
(Keep -Wmsvc-include around as an alias.)
While here, also replace the one other mention of "MSVC" in diagnostics with
"Microsoft", for consistency.
llvm-svn: 243444
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
There is currently no support in MSVC for using i128 as an integer
literal suffix. In fact, there appears to be no evidence that they have
ever supported this feature in any of their compilers. This was an over
generalization of their actual feature and is a nasty source of bugs.
Why is it a source of bugs? Because most code in clang expects that
evaluation of an integer constant expression won't give them something
that 'long long' can't represent. Instead of providing a meaningful
feature, i128 gives us cute ways of exploding the compiler.
llvm-svn: 243243
|
| |
|
|
|
|
|
|
|
|
| |
We treated DependentSizedArrayTypes with the same element type but
differing size expressions as equivalently canonical. This would lead
to bizarre behavior during template instantiation.
This fixes PR24212.
llvm-svn: 243093
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
to consider the storage size of the vector instead of its
sizeof. In other words, ban <3 x int> to <4 x int> casts,
which produced invalid IR anyway.
Also, attempt to be a little more rigorous, or at least
explicit, about when enums are allowed in these casts.
rdar://21901132
llvm-svn: 243069
|
| |
|
|
|
|
|
|
| |
overloaded.
Suggested by Richard Smith.
llvm-svn: 242980
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
MSVC 2013 ships, as part of its STL implementation, a class named
'_Atomic'. This is unfortunate because this keyword is in conflict with
the C11 keyword with the same name. Our solution was to disable this
keyword when targeting MSVC 2013 and reenable it for 2015.
However, this makes it impossible for clang's headers to make use of
_Atomic. This is problematic in the case of libc++ as it makes heavy
use of this keyword.
Let the keywordness of _Atomic float under certain circumstances:
the body of a class named _Atomic, or a class with a base specifier
named _Atomic, will not have the keyword variant of _Atomic for the
duration of the class body. This is sufficient to allow us to correctly
handle _Atomic in the STL while permitting us to use _Atomic as a
keyword everywhere else.
Differential Revision: http://reviews.llvm.org/D11233
llvm-svn: 242970
|