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

C error is constant used as enum value before it is defined #21916

Closed
JalonSolov opened this issue Jul 23, 2024 · 0 comments · Fixed by #21919
Closed

C error is constant used as enum value before it is defined #21916

JalonSolov opened this issue Jul 23, 2024 · 0 comments · Fixed by #21919
Labels
Bug This tag is applied to issues which reports bugs.

Comments

@JalonSolov
Copy link
Contributor

JalonSolov commented Jul 23, 2024

V doctor:

V full version: V 0.4.6 efa98d9.6bea0cb
OS: linux, "Manjaro Linux"
Processor: 32 cpus, 64bit, little endian, AMD Ryzen 9 7950X 16-Core Processor

getwd: /home/jalon
vexe: /home/jalon/git/v/v
vexe mtime: 2024-07-23 13:12:49

vroot: OK, value: /home/jalon/git/v
VMODULES: OK, value: /home/jalon/.vmodules
VTMP: OK, value: /tmp/v_1000

Git version: git version 2.45.2
Git vroot status: weekly.2024.30-5-g6bea0cb3
.git/config present: true

CC version: cc (GCC) 14.1.1 20240522
thirdparty/tcc status: thirdparty-linux-amd64 40e5cbb5

What did you do?
v -g -o vdbg cmd/v && vdbg x.v

enum Foo {
	a = c
	b = 1
	c = 2
}

const c = 0

What did you expect to see?

V error message, not C.

What did you see instead?

================== C compilation error (from tcc): ==============
cc: /tmp/v_1000/x.01J3FY4BD93TB5RFHY1XD9FEDZ.tmp.c:839: error: '_const_main__c' undeclared
=================================================================

Note

You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.

@JalonSolov JalonSolov added the Bug This tag is applied to issues which reports bugs. label Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This tag is applied to issues which reports bugs.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant