Anders Carlsson | abea951 | 2011-02-28 00:40:07 +0000 | [diff] [blame^] | 1 | // RUN: %clang_cc1 -fcxx-exceptions -fexceptions -fsyntax-only -std=c++0x -verify %s |
Douglas Gregor | 2f2433f | 2009-05-18 21:08:14 +0000 | [diff] [blame] | 2 | |
| 3 | template<typename T> struct TryCatch0 { |
| 4 | void f() { |
| 5 | try { |
| 6 | } catch (T&&) { // expected-error 2{{cannot catch exceptions by rvalue reference}} |
| 7 | } |
| 8 | } |
| 9 | }; |
| 10 | |
| 11 | template struct TryCatch0<int&>; // okay |
| 12 | template struct TryCatch0<int&&>; // expected-note{{instantiation}} |
| 13 | template struct TryCatch0<int>; // expected-note{{instantiation}} |
| 14 | |