summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2015-02-13 19:49:59 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2015-02-13 19:49:59 +0000
commit46598206b5947afc123d5cf79ec7568272097fa4 (patch)
tree2a62cb7570c6d8c05786fdaf8015d189b969767a /clang/test
parentec216500f23f757d8007e6f071250c0a7ba38101 (diff)
downloadbcm5719-llvm-46598206b5947afc123d5cf79ec7568272097fa4.tar.gz
bcm5719-llvm-46598206b5947afc123d5cf79ec7568272097fa4.zip
PR17938: This has already been fixed, add regression test.
llvm-svn: 229146
Diffstat (limited to 'clang/test')
-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