summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEllie Hermaszewska <ellieh@nvidia.com>2023-05-30 23:29:16 +0800
committerGitHub <noreply@github.com>2023-05-30 15:29:16 +0000
commit4c1396c3532d6ad4973177d1c97578989385f347 (patch)
tree619929db1811e4b675753cd28c88211cc7f04f0a /tests
parentab284ca61d0c4c29ac7331b99a98f95bb3ad44e5 (diff)
Disallow duplicate enumerator names in the same enum (#2904)
Fixes https://github.com/shader-slang/slang/issues/2895
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs/overloaded-enum.slang10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/bugs/overloaded-enum.slang b/tests/bugs/overloaded-enum.slang
new file mode 100644
index 000000000..3b9ac8e10
--- /dev/null
+++ b/tests/bugs/overloaded-enum.slang
@@ -0,0 +1,10 @@
+//TEST:SIMPLE(filecheck=CHECK):
+
+enum E
+{
+ A,
+ A
+ // CHECK: overloaded-enum.slang([[#@LINE-1]]): error 30200: declaration of 'A' conflicts with existing declaration
+}
+
+E e = E::A;