summaryrefslogtreecommitdiff
path: root/cross-project-tests
diff options
context:
space:
mode:
authorShafik Yaghmour <shafik.yaghmour@intel.com>2022-07-28 15:26:15 -0700
committerShafik Yaghmour <shafik.yaghmour@intel.com>2022-07-28 15:27:50 -0700
commitb3645353041818f61e2580635409ddb81ff5a272 (patch)
tree84e6c16d57e685b4721c16f4261d4c5e73263fd3 /cross-project-tests
parent58526b2d2be932e893218857cc47a16fb05cf1c0 (diff)
downloadllvm-b3645353041818f61e2580635409ddb81ff5a272.tar.gz
[Clang] Diagnose ill-formed constant expression when setting a non fixed enum to a value outside the range of the enumeration values
DR2338 clarified that it was undefined behavior to set the value outside the range of the enumerations values for an enum without a fixed underlying type. We should diagnose this with a constant expression context. Differential Revision: https://reviews.llvm.org/D130058
Diffstat (limited to 'cross-project-tests')
-rw-r--r--cross-project-tests/debuginfo-tests/clang_llvm_roundtrip/simplified_template_names.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/cross-project-tests/debuginfo-tests/clang_llvm_roundtrip/simplified_template_names.cpp b/cross-project-tests/debuginfo-tests/clang_llvm_roundtrip/simplified_template_names.cpp
index 3990c2809e2e..6b2807ccaf13 100644
--- a/cross-project-tests/debuginfo-tests/clang_llvm_roundtrip/simplified_template_names.cpp
+++ b/cross-project-tests/debuginfo-tests/clang_llvm_roundtrip/simplified_template_names.cpp
@@ -25,9 +25,9 @@ struct udt { };
}
template<template<typename> class T>
void ttp_user() { }
-enum Enumeration { Enumerator1, Enumerator2, Enumerator3 = 1 };
+enum Enumeration : int { Enumerator1, Enumerator2, Enumerator3 = 1 };
enum class EnumerationClass { Enumerator1, Enumerator2, Enumerator3 = 1 };
-enum { AnonEnum1, AnonEnum2, AnonEnum3 = 1 };
+enum : int { AnonEnum1, AnonEnum2, AnonEnum3 = 1 };
enum EnumerationSmall : unsigned char { kNeg = 0xff };
}
template <typename... Ts>