Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -emit-llvm-only -verify %s |
Andy Gibbs | 8e8fb3b | 2012-10-19 12:44:48 +0000 | [diff] [blame] | 2 | // expected-no-diagnostics |
Eli Friedman | 0398101 | 2009-12-11 02:42:07 +0000 | [diff] [blame] | 3 | |
| 4 | struct XPTParamDescriptor {}; |
| 5 | struct nsXPTParamInfo { |
| 6 | nsXPTParamInfo(const XPTParamDescriptor& desc); |
| 7 | }; |
| 8 | void a(XPTParamDescriptor *params) { |
| 9 | const nsXPTParamInfo& paramInfo = params[0]; |
| 10 | } |
Chandler Carruth | 5535c38 | 2010-01-12 20:32:25 +0000 | [diff] [blame] | 11 | |
| 12 | // CodeGen of reference initialized const arrays. |
| 13 | namespace PR5911 { |
| 14 | template <typename T, int N> int f(const T (&a)[N]) { return N; } |
| 15 | int iarr[] = { 1 }; |
| 16 | int test() { return f(iarr); } |
| 17 | } |
Fariborz Jahanian | f7c00ed | 2010-01-25 18:30:26 +0000 | [diff] [blame] | 18 | |
| 19 | // radar 7574896 |
| 20 | struct Foo { int foo; }; |
| 21 | Foo& ignoreSetMutex = *(new Foo); |
| 22 | |
Douglas Gregor | de4b1d8 | 2010-01-29 19:14:02 +0000 | [diff] [blame] | 23 | // Binding to a bit-field that requires a temporary. |
| 24 | struct { int bitfield : 3; } s = { 3 }; |
| 25 | const int &s2 = s.bitfield; |