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

Deprecated copy warning with GCC-12 #22

Open
voskh0d opened this issue Mar 30, 2023 · 0 comments
Open

Deprecated copy warning with GCC-12 #22

voskh0d opened this issue Mar 30, 2023 · 0 comments

Comments

@voskh0d
Copy link

voskh0d commented Mar 30, 2023

When compiling with g++ (GCC) 12.2.0, ac_bitref functions and ac_int::operator[] will produce a deprecated copy warning. Here an example on how to reproduce them:

#include "ac_int.h"

int main() {
  ac_int<3,false> a;
  a[0] = 1;
  return 0;
}

Compiled with g++ -Wall -Wextra -std=c++17 -I . t.cc

Produces:

ac_int.h: In instantiation of 'ac_int<W, S>::ac_bitref ac_int<W, S>::operator[](int) [with int W = 3; bool S = false]':
t.cc:5:6:   required from here
ac_int.h:2603:12: warning: implicitly-declared 'constexpr ac_int<3, false>::ac_bitref::ac_bitref(const ac_int<3, false>::ac_bitref&)' is deprecated [-Wdeprecated-copy]
 2603 |     return bvh;
      |            ^~~
ac_int.h:2588:22: note: because 'ac_int<3, false>::ac_bitref' has user-provided 'ac_int<W, S>::ac_bitref ac_int<W, S>::ac_bitref::operator=(const ac_int<W, S>::ac_bitref&) [with int W = 3; bool S = false]'
 2588 |     inline ac_bitref operator = ( const ac_bitref &val ) {
      |                      ^~~~~~~~
ac_int.h: In instantiation of 'ac_int<W, S>::ac_bitref ac_int<W, S>::ac_bitref::operator=(int) [with int W = 3; bool S = false]':
t.cc:5:10:   required from here
ac_int.h:2582:15: warning: implicitly-declared 'constexpr ac_int<3, false>::ac_bitref::ac_bitref(const ac_int<3, false>::ac_bitref&)' is deprecated [-Wdeprecated-copy]
 2582 |       return *this;
      |               ^~~~
ac_int.h:2588:22: note: because 'ac_int<3, false>::ac_bitref' has user-provided 'ac_int<W, S>::ac_bitref ac_int<W, S>::ac_bitref::operator=(const ac_int<W, S>::ac_bitref&) [with int W = 3; bool S = false]'
 2588 |     inline ac_bitref operator = ( const ac_bitref &val ) {
      |                      ^~~~~~~~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant