public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/105563] New: Consteval copy-constructor is allowed in not-constant expression
@ 2022-05-11 11:17 fchelnokov at gmail dot com
  2022-05-11 13:39 ` [Bug c++/105563] " mpolacek at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: fchelnokov at gmail dot com @ 2022-05-11 11:17 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105563

            Bug ID: 105563
           Summary: Consteval copy-constructor is allowed in not-constant
                    expression
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: fchelnokov at gmail dot com
  Target Milestone: ---

In the following program, struct A has `consteval` copy-constructor, which is 
invoked in main() run-time via A{a1}:

struct A {
    int i = 0;
    A() {}
    consteval A(const A&) = default;
};

int main() {
    A a1;
    A{a1};
}

Both Clang and MSVC reject this program, but not GCC. Demo:
https://gcc.godbolt.org/z/4G7ndne35

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug c++/105563] Consteval copy-constructor is allowed in not-constant expression
  2022-05-11 11:17 [Bug c++/105563] New: Consteval copy-constructor is allowed in not-constant expression fchelnokov at gmail dot com
@ 2022-05-11 13:39 ` mpolacek at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-05-11 13:39 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105563

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2022-05-11
                 CC|                            |mpolacek at gcc dot gnu.org

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Confirmed.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-05-11 13:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-11 11:17 [Bug c++/105563] New: Consteval copy-constructor is allowed in not-constant expression fchelnokov at gmail dot com
2022-05-11 13:39 ` [Bug c++/105563] " mpolacek at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).