summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/constant-expression-cxx11.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/SemaCXX/constant-expression-cxx11.cpp')
-rw-r--r--clang/test/SemaCXX/constant-expression-cxx11.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/constant-expression-cxx11.cpp b/clang/test/SemaCXX/constant-expression-cxx11.cpp
index 14c0ae320d7..9c62e9eb6d8 100644
--- a/clang/test/SemaCXX/constant-expression-cxx11.cpp
+++ b/clang/test/SemaCXX/constant-expression-cxx11.cpp
@@ -1984,3 +1984,13 @@ struct InvalidRedef {
int f; // expected-note{{previous definition is here}}
constexpr int f(void); // expected-error{{redefinition of 'f'}} expected-warning{{will not be implicitly 'const'}}
};
+
+namespace PR17938 {
+ template <typename T> constexpr T const &f(T const &x) { return x; }
+
+ struct X {};
+ struct Y : X {};
+ struct Z : Y { constexpr Z() {} };
+
+ static constexpr auto z = f(Z());
+}
OpenPOWER on IntegriCloud