diff options
Diffstat (limited to 'test/CXX/drs/dr15xx.cpp')
-rw-r--r-- | test/CXX/drs/dr15xx.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/CXX/drs/dr15xx.cpp b/test/CXX/drs/dr15xx.cpp new file mode 100644 index 000000000000..66618c1716d6 --- /dev/null +++ b/test/CXX/drs/dr15xx.cpp @@ -0,0 +1,20 @@ +// RUN: %clang_cc1 -std=c++98 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors +// RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors +// RUN: %clang_cc1 -std=c++1y -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors + +// expected-no-diagnostics + +namespace DR1550 { // dr1550: yes + int f(bool b, int n) { + return (b ? (throw 0) : n) + (b ? n : (throw 0)); + } +} + +namespace DR1560 { // dr1560: 3.5 + void f(bool b, int n) { + (b ? throw 0 : n) = (b ? n : throw 0) = 0; + } + class X { X(const X&); }; + const X &get(); + const X &x = true ? get() : throw 0; +} |