Commit c25520e8 by Jason Merrill

new

From-SVN: r17551
parent 31fa4410
extern "C" void abort();
struct S
{
char c;
double d;
};
template <class T>
void foo(T)
{
if (__alignof__(T) != __alignof__(S))
abort();
}
int main()
{
foo(S());
}
void f(int) {}
void f(double);
template <void (*fn)(int)>
void foo() {}
int main()
{
foo<f>();
}
extern "C" void abort();
template <int I>
int bar() { return I; }
template <class T>
int foo(T)
{
return bar<sizeof(T) + 4>() + bar<sizeof(long) + 7>();
}
int main()
{
if (foo(2) != sizeof(int) + 4 + sizeof(long) + 7)
abort();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment