diff options
| author | Douglas Gregor <dgregor@apple.com> | 2011-06-01 15:55:51 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2011-06-01 15:55:51 +0000 |
| commit | 981e37d7277793ced09d1bd881fc30ccfb8bb912 (patch) | |
| tree | eb794e8d08f7fb1cb4ee098c93681947c0eea90a /clang/test/CXX/except/except.spec | |
| parent | 4d2fe66dc0e22ffff463b10b7bef7ce7e79f1845 (diff) | |
| download | bcm5719-llvm-981e37d7277793ced09d1bd881fc30ccfb8bb912.tar.gz bcm5719-llvm-981e37d7277793ced09d1bd881fc30ccfb8bb912.zip | |
The expression in a noexcept exception-specification is a
constant-expression, and, therefore, an unevaluated operand. Make it
so.
llvm-svn: 132400
Diffstat (limited to 'clang/test/CXX/except/except.spec')
| -rw-r--r-- | clang/test/CXX/except/except.spec/p1.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/test/CXX/except/except.spec/p1.cpp b/clang/test/CXX/except/except.spec/p1.cpp index 0559285e77a..86924bb49d7 100644 --- a/clang/test/CXX/except/except.spec/p1.cpp +++ b/clang/test/CXX/except/except.spec/p1.cpp @@ -58,3 +58,16 @@ namespace noex { void g2(bool b) noexcept(b); // expected-error {{argument to noexcept specifier must be a constant expression}} } + +namespace noexcept_unevaluated { + template<typename T> void f(T) { + T* x = 1; + } + + template<typename T> + void g(T x) noexcept((f(x), sizeof(T) == 4)) { } + + void h() { + g(1); + } +} |

