| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
Marking a class' destructor final prevents the class from being inherited from. However, it is a subtle and awkward way to express that at best, and unintended at worst. It may also generate worse code (in other compilers) than marking the class itself final. For these reasons, this revision adds a warning for nonfinal classes with final destructors, with a note to suggest marking the class final to silence the warning.
See https://reviews.llvm.org/D66621 for more background.
Patch by logan-5 (Logan Smith)
Differential Revision: https://reviews.llvm.org/D66711
llvm-svn: 370594
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
-fms-extensions is intended to enable conforming language extensions and
-fms-compatibility is intended to language rule relaxations, so a user
could plausibly compile with -fno-ms-compatibility on Windows while
still using dllexport, for example. This exception specification
validation behavior has been handled as a warning since before
-fms-compatibility was added in 2011. I think it's just an oversight
that it hasn't been moved yet.
This will help users find conformance issues in their code such as those
found in _com_ptr_t as described in https://llvm.org/PR42842.
Reviewers: hans
Subscribers: STL_MSFT, cfe-commits
Differential Revision: https://reviews.llvm.org/D66770
llvm-svn: 370087
|
|
|
|
|
|
|
|
|
| |
The implementation of the NoThrow ExceptionSpecificationType missed a
switch statement for forming the diagnostic when an out-of-line member
redeclaration misses the exception specification. This patch adds the
correct case statement.
llvm-svn: 362225
|
|
|
|
|
|
|
|
|
| |
More generally, this permits a template to be specialized in any scope in which
it could be defined, so this also supersedes DR44 and DR374 (the latter of
which we previously only implemented in C++11 mode onwards due to unclarity as
to whether it was a DR).
llvm-svn: 327705
|
|
|
|
|
|
|
|
| |
Do not discard invalid Decl when searching for the operator delete function.
The lookup for this function always expects to find a result, so sometimes the
invalid Decl is the only choice possible. This fixes PR34109.
llvm-svn: 310435
|
|
|
|
|
|
|
|
|
|
| |
isMicrosoftMissingTypename() uses a Type pointer without first checking
that it's non-null. PR32750 reports a case where the pointer is in fact
null. This patch adds in a defensive check and a regression test.
Differential Revision: https://reviews.llvm.org/D32519
llvm-svn: 301420
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D29520
llvm-svn: 294225
|
|
|
|
|
|
|
|
|
| |
Treating large 0x*LL literals as signed instead of unsigned is not a
conforming language extension, so move it out of -fms-extensions.
Came up in PR30605
llvm-svn: 283227
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This implements support for MS-specific __unaligned qualifier in functions and
makes the following test case both compile and mangle correctly:
struct S {
void f() __unaligned;
};
void S::f() __unaligned {
}
Differential Revision: http://reviews.llvm.org/D20437
llvm-svn: 270834
|
|
|
|
|
|
|
|
|
|
|
| |
This patch implements __unaligned (MS extension) as a proper type qualifier
(before that, it was implemented as an ignored attribute).
It also fixes PR27367 and PR27666.
Differential Revision: http://reviews.llvm.org/D20103
llvm-svn: 269220
|
|
|
|
| |
llvm-svn: 268736
|
|
|
|
|
|
|
|
|
|
|
| |
This patch implements __unaligned (MS extension) as a proper type qualifier
(before that, it was implemented as an ignored attribute).
It also fixes PR27367.
Differential Revision: http://reviews.llvm.org/D19654
llvm-svn: 268727
|
|
|
|
| |
llvm-svn: 266431
|
|
|
|
|
|
|
|
|
|
|
| |
This patch implements __unaligned as a type qualifier; before that, it was
modeled as an attribute. Proper mangling of __unaligned is implemented as well.
Some OpenCL code/tests are tangenially affected, as they relied on existing
number and sizes of type qualifiers.
Differential Revision: http://reviews.llvm.org/D18596
llvm-svn: 266415
|
|
|
|
|
|
|
|
|
|
|
| |
pointer-to-object iff -fms-compatibility
We permit implicit conversion from pointer-to-function to
pointer-to-object when -fms-extensions is specified. This is rather
unfortunate, move this into -fms-compatibility and only permit it within
system headers unless -Wno-error=microsoft-cast is specified.
llvm-svn: 251738
|
|
|
|
|
|
|
|
|
|
|
| |
as an extension
Microsoft's ATL headers make use of this MSVC extension, add support for
it and issue a diagnostic under -Wmicrosoft-exception-spec.
This fixes PR25265.
llvm-svn: 250854
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Fixes PR22671.
Reviewers: rsmith
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D7863
llvm-svn: 230362
|
|
|
|
|
|
|
|
| |
The __unaligned keyword can appear after a struct definition:
struct foo {...} __unaligned *x;
llvm-svn: 223412
|
|
|
|
|
|
|
| |
overriding methods. Patch review by Richard Smith.
rdar://18295240
llvm-svn: 220703
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This CL has caused bootstrap failures on Linux and OSX buildbots running with -Werror.
Example report from http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/13183/steps/bootstrap%20clang/logs/stdio:
================================================================
[ 91%] Building CXX object tools/clang/tools/diagtool/CMakeFiles/diagtool.dir/ShowEnabledWarnings.cpp.o
In file included from /home/dtoolsbot/build/sanitizer-x86_64-linux/build/llvm/lib/Target/R600/AMDGPUISelDAGToDAG.cpp:20:
In file included from /home/dtoolsbot/build/sanitizer-x86_64-linux/build/llvm/lib/Target/R600/SIISelLowering.h:19:
/home/dtoolsbot/build/sanitizer-x86_64-linux/build/llvm/lib/Target/R600/SIInstrInfo.h:71:8: error: 'getLdStBaseRegImmOfs' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
bool getLdStBaseRegImmOfs(MachineInstr *LdSt,
^
/home/dtoolsbot/build/sanitizer-x86_64-linux/build/llvm/include/llvm/Target/TargetInstrInfo.h:815:16: note: overridden virtual function is here
virtual bool getLdStBaseRegImmOfs(MachineInstr *LdSt,
^
================================================================
llvm-svn: 218969
|
|
|
|
|
|
|
|
|
|
|
|
| |
for an overriding method if class has at least one
'override' specified on one of its methods.
Reviewed by Doug Gregor. rdar://18295240
(I have already checked in all llvm files with missing 'override'
methods and Bob Wilson has fixed a TableGen of FastISel so
no warnings are expected from build of llvm after this patch.
I have already verified this).
llvm-svn: 218925
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The relevant portion of C++ standard says [namespace.memdef]p3:
If the name in a friend declaration is neither qualified nor a
template-id and the declaration is a function or an
elaborated-type-specifier, the lookup to determine whether the entity
has been previously declared shall not consider any scopes outside the
innermost enclosing namespace.
MSVC does not implement that rule for types. If there is a type in an
enclosing namespace, they consider an unqualified tag declaration with
the same name to be a redeclaration of the type from another namespace.
Implementing compatibility is a simple matter of disabling our
implementation of this rule for types, which was added in r177473.
Reviewers: rsmith
Differential Revision: http://reviews.llvm.org/D4443
llvm-svn: 212784
|
|
|
|
|
|
|
|
|
|
|
| |
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 is a step towards handling these attributes on classes (PR11170).
Differential Revision: http://reviews.llvm.org/D3772
llvm-svn: 208925
|
|
|
|
|
|
|
| |
A redeclaration may not add dllimport or dllexport attributes. dllexport is
sticky and can be omitted on redeclarations while dllimport cannot.
llvm-svn: 205197
|
|
|
|
|
|
|
| |
-Wunused-comparison. Also, newly warn on unused result from overloaded
relational comparisons, now also in -Wunused-comparison.
llvm-svn: 203535
|
|
|
|
|
|
|
|
| |
It was previously enabled in both but should only have been part of the drop-in
quirks mode that is 'MicrosoftMode' given that it's only useful for
compatibility with the Microsoft headers/runtime.
llvm-svn: 198548
|
|
|
|
|
|
| |
semantic attributes easier (and not require hard-coded strings). This requires a getSpelling() function on the Attr class, which is table-driven. Updates a handful of cases where a hard-coded string was being used to test the functionality out. Updating associated test cases for the improved quoting.
llvm-svn: 198055
|
|
|
|
|
|
|
|
|
|
| |
MSVC applies these to the following declaration only if present, otherwise
silently ignores them whereas we'll issue a warning.
Handling differs from ordinary attributes appearing in the same place, so add a
Sema test to make sure we get it right.
llvm-svn: 195577
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
'final'
Summary: Some MS headers use these features.
Reviewers: rnk, rsmith
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1948
llvm-svn: 192936
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
tag with that name in an enclosing scope.
r177473 made us correctly consider only those declarations in the
enclosing namespace scope when looking for a friend declaration. Under
ms-extensions mode, where we do some level of friend injection, this
meant that we were introducing a new tag type into a different scope
than what Microsoft actually does. Address this by only doing the
friend injection when we didn't see any tag with that name in any
outer scope. Fixes <rdar://problem/14250378>.
llvm-svn: 185100
|
|
|
|
|
|
|
|
| |
declaration with no name.
Patch thanks to Robert Wilhelm.
llvm-svn: 185022
|
|
|
|
|
|
|
|
| |
This fixes an issue when parsing atlbase.h.
Patch by Will Wilson!
llvm-svn: 184319
|
|
|
|
|
|
|
|
|
|
|
|
| |
This became allowed by accident in r131201, but triggers an assert.
That patch added an exception to allow conversion from pointers to
narrow integral types for MSVC compatibility. However, a pointer can
already be converted to bool in a civilized manner; allowing conversion
via reinterpret_cast is a bad idea.
Fixes PR16222.
llvm-svn: 183394
|
|
|
|
|
|
|
| |
references. What's more, they use this language extension in their
ATL header files (which come as part of MFC and the Win32 SDK). This patch implements support for the Microsoft extension, and addresses PR13737.
llvm-svn: 182936
|
|
|
|
|
|
|
|
|
| |
type-dependent intermediate result in a postfix ++ pseudo-
object operation.
Test case by Tong Shen.
llvm-svn: 179637
|
|
|
|
|
|
|
|
| |
references thereto.
Patch by Tong Shen!
llvm-svn: 179585
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
MSVC accepts this:
class A {
A::A();
};
Clang accepts regular member functions with extra qualification as an MS
extension, but not constructors. This changes the parser to defer rejecting
qualified constructors so that the same Sema logic can apply to constructors as
regular member functions. This also improves the error message when MS
extensions are disabled (in my opinion). Before it was:
/Users/jason/Desktop/test.cpp:2:8: error: expected member name or ';' after declaration specifiers
A::A();
~~~~ ^
1 error generated.
After:
/Users/jason/Desktop/test.cpp:2:6: error: extra qualification on member 'A'
A::A();
~~~^
1 error generated.
Patch by Jason Haslam.
llvm-svn: 174980
|
|
|
|
|
|
| |
cite C++11.
llvm-svn: 167273
|
|
|
|
|
|
|
|
| |
warning to an error. C++ bans it, and both GCC and EDG diagnose it as
an error. Microsoft allows it, so we still warn in Microsoft
mode. Fixes <rdar://problem/11135644>.
llvm-svn: 163831
|
|
|
|
|
|
| |
so -fms-extensions doesn't affect enum semantics in incompatible ways. <rdar://problem/10657186>.
llvm-svn: 150663
|
|
|
|
|
|
| |
enumerator that were introduced with r148439. Otherwise MSVC headers won't compile in C++ 11 mode.
llvm-svn: 148642
|
|
|
|
|
|
|
| |
keyword, because both libstdc++ and libc++ use "__except" as an
identifier. Fixes <rdar://problem/10322555>.
llvm-svn: 142636
|
|
|
|
|
|
|
| |
in -fms-extensions mode, make sure we actually use that initializer
after having handled the declaration. Fixes PR11150.
llvm-svn: 142195
|
|
|
|
|
|
| |
-fms-compatibility. Also allow the missing typename warning at function scope.
llvm-svn: 140240
|
|
|
|
|
|
| |
-fm-compatibility.
llvm-svn: 140189
|
|
|
|
|
|
| |
from -fms-extensions to -fms-compatibility.
llvm-svn: 140008
|
|
|
|
|
|
| |
Also add a test case for the non Microsoft case because such test didn't exist.
llvm-svn: 139971
|
|
|
|
|
|
|
|
| |
warning if we are jumping over a variable initialization via a goto.
This fixes a few errors when parsing MFC code with clang.
llvm-svn: 139595
|