Sign in
gnu
/
gcc
/
cd2fd5facb5e1882d3f338ed456ae9536f7c0593
/
.
/
gcc
/
testsuite
/
g++.dg
/
cpp0x
/
constexpr-switch.C
blob: ee94159f09d09e00f5be14f948b4104656c66bfe [
file
] [
log
] [
blame
]
// { dg-do compile { target c++11 } }
template
<
class
T
>
constexpr
T value
(
T t
=
T
())
{
return
t
;
}
enum
us_enum
{
us_item
=
value
<short>
()
};
// OK
void
func
(
us_enum n
)
{
switch
(
n
)
{
case
value
(
us_item
):
;
// #1 Error
default
:
;
}
}