1 // RUN: %clang_cc1 -std=c++98 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
2 // RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
3 // RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
4 // RUN: %clang_cc1 -std=c++1z -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
5 
6 // expected-no-diagnostics
7 
8 namespace dr1550 { // dr1550: yes
f(bool b,int n)9   int f(bool b, int n) {
10     return (b ? (throw 0) : n) + (b ? n : (throw 0));
11   }
12 }
13 
14 namespace dr1560 { // dr1560: 3.5
f(bool b,int n)15   void f(bool b, int n) {
16     (b ? throw 0 : n) = (b ? n : throw 0) = 0;
17   }
18   class X { X(const X&); };
19   const X &get();
20   const X &x = true ? get() : throw 0;
21 }
22