blob: 110c380c9aa2a5d9d31b84526772b572120cb71c [file] [log] [blame]
Douglas Gregorce940492009-09-25 04:25:58 +00001// RUN: clang-cc -fsyntax-only %s
2
3template<typename T, int N>
4struct X0 {
5 const char *f0(bool Cond) {
6 return Cond? "honk" : N;
7 }
8
9 const char *f1(bool Cond) {
10 return Cond? N : "honk";
11 }
12
13 bool f2(const char *str) {
14 return str == N;
15 }
16};
17
18// PR4996
19template<unsigned I> int f0() {
20 return __builtin_choose_expr(I, 0, 1);
21}
22
23// PR5041
24struct A { };
25
26template <typename T> void f(T *t)
27{
28 (void)static_cast<void*>(static_cast<A*>(t));
Daniel Dunbar4fcfde42009-11-08 01:45:36 +000029}