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

internal compiler error: in verify_ctor_sanity, at cp/constexpr.c:2697 #507

Open
Ebola-Chan-bot opened this issue Oct 22, 2022 · 0 comments
Labels

Comments

@Ebola-Chan-bot
Copy link

Ebola-Chan-bot commented Oct 22, 2022

Minimal repro demo:

struct InfoEntry
{
	bool Value;
	constexpr InfoEntry(bool Value) : Value(Value) {}
};
struct InfoDict
{
	InfoEntry Entry[1];
  constexpr InfoDict(InfoEntry Entry):Entry({Entry}){}
  //constexpr InfoDict(InfoEntry Entry):Entry{Entry}{}   //This line is OK. Only differs in the should-be-optional parenthesis.
};
void setup()
{
  constexpr InfoDict ID(InfoEntry(true));
  //constexpr InfoDict ID(true);    //This line is OK. It looks like the compiler can only handle POD types here.
}
void loop()
{}

Environments:

v1.8.5
-std=gnu++17
Arduino Mega or Mega 2560
Arduino IDE 2.0.0
Windows 11

Full error prompt:

C:\Users\vhtmf\Documents\Arduino\sketch_sep21a\sketch_sep21a.ino: In function 'void setup()':
C:\Users\vhtmf\Documents\Arduino\sketch_sep21a\sketch_sep21a.ino:13:40:   in constexpr expansion of 'InfoDict(InfoEntry(true))'
C:\Users\vhtmf\Documents\Arduino\sketch_sep21a\sketch_sep21a.ino:13:40: internal compiler error: in verify_ctor_sanity, at cp/constexpr.c:2697
   constexpr InfoDict ID(InfoEntry(true));
                                        ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.

exit status 1

Compilation error: exit status 1
@per1234 per1234 added the bug label Oct 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants