Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing warning deprecated copy constructor warning in -Wextra #95

Open
roe85 opened this issue Jan 15, 2020 · 2 comments
Open

Missing warning deprecated copy constructor warning in -Wextra #95

roe85 opened this issue Jan 15, 2020 · 2 comments
Labels
c++ clang:diagnostics New/improved warning or error message in Clang, but not in clang-tidy or static analyzer

Comments

@roe85
Copy link

roe85 commented Jan 15, 2020

There seems to be some interference between -Wdeprecated-copy-dtor and -Wdeprecated-copy which leads to emitting only the first one.
Demo: https://gcc.godbolt.org/z/_8Dx4K
This is bad because only the second is governed by -Wextra, which is likelier to be activated. The code attached is not warned about whith -Wextra unless the destructor is commented out. GCC warns in either case.
I think there is no reason, why both warnings shouldn't be governed with -Wextra.

class A {
    public:
    void b();
    ~A();
    A& operator=(const A& a);

};
void test() {
    
    A a;

    A b = a;
    a = b;

    (void)a;
    (void)b;
}
@Quuxplusone Quuxplusone added c++ clang:diagnostics New/improved warning or error message in Clang, but not in clang-tidy or static analyzer labels Jan 19, 2022
@Quuxplusone
Copy link
Contributor

This behavior was altered beyond recognition by the fix for #44979, so maybe this can be closed. -Wdeprecated now says:

<source>:6:5: warning: definition of implicit copy constructor for 'A' is deprecated because it has a user-provided destructor [-Wdeprecated-copy-with-user-provided-dtor]
    ~A();
    ^
<source>:14:11: note: in implicit copy constructor for 'A' first required here
    A b = a;
          ^

But this warning is still enabled only by -Wdeprecated, not by -Wall or -Wextra. I think it would be nice to enable it under -Wextra, at least, since it does usually indicate a bug or at least a time bomb.

@llvmbot
Copy link
Collaborator

llvmbot commented Jan 19, 2022

@llvm/issue-subscribers-c-1

jamesmth pushed a commit to jamesmth/llvm-project that referenced this issue Dec 5, 2022
…llvm#95)

When a large "irregular" (e.g. i96) integer call argument is converted to
indirect, 64-bit parts are stored to the stack. The full stack space
(e.g. i128) was not allocated prior to this patch, but rather just the exact
space of the original type. This caused neighboring values on the stack to be
overwritten.

Thanks to Josh Stone for reporting this.

Review: Ulrich Weigand
Fixes https://bugs.llvm.org/show_bug.cgi?id=49322
Differential Revision: https://reviews.llvm.org/D97514

(cherry picked from commit 52bbbf4)

Co-authored-by: Jonas Paulsson <paulsson@linux.vnet.ibm.com>
JonChesterfield pushed a commit to JonChesterfield/llvm-project that referenced this issue Jun 4, 2024
* Update env.rst syntax

* Update env.rst

corrected HIP_PLATFORM example

---------

Co-authored-by: randyh62 <42045079+randyh62@users.noreply.github.com>
RevySR pushed a commit to revyos/llvm-project that referenced this issue Jul 27, 2024
…nor/vmxnor` (llvm#95)

* [LLVM][XTHeadVector] Implement 16.1 `vmand/vmnand/vmandn/vmxor/vmor/vmnor/vmorn/vmxnor`

* [LLVM][XTHeadVector] Test 16.1 `vmand/vmnand/vmandn/vmxor/vmor/vmnor/vmorn/vmxnor`

* [LLVM][XTHeadVector] Implement 16.1 `vmclr/vmset`

* [LLVM][XTHeadVector] Test 16.1 `vmclr/vmset`
alexanderguy pushed a commit to alexanderguy/llvm-project that referenced this issue Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ clang:diagnostics New/improved warning or error message in Clang, but not in clang-tidy or static analyzer
Projects
None yet
Development

No branches or pull requests

3 participants