Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clang/lib/AST/ByteCode/Opcodes.td
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ def CheckDecl : Opcode {

def CheckEnumValue : Opcode {
let Args = [ArgEnumDecl];
let Types = [FixedSizeIntegralTypeClass];
let Types = [IntegralTypeClass];
let HasGroup = 1;
}

Expand Down
14 changes: 13 additions & 1 deletion clang/test/AST/ByteCode/intap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,19 @@ constexpr int shifts() { // both-error {{never produces a constant expression}}
(void)(2 << b); // ref-warning {{shift count is negative}}
return 1;
}
#endif

namespace UnderlyingInt128 {
enum F {
a = (__int128)-1
};

constexpr int foo() { // both-error {{never produces a constant expression}}
F f = (F)(__int128)10; // both-note 2{{integer value 10 is outside the valid range of values [-1, 0] for the enumeration type 'F'}}
return (int)f;
}
static_assert(foo() == 0, ""); // both-error {{not an integral constant expression}} \
// both-note {{in call to}}
}
#endif

#endif