summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate/instantiate-local-class.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2015-04-29 00:07:09 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2015-04-29 00:07:09 +0000
commit180b92168dd61c0d6c61eaa241c3c21bd892a19b (patch)
tree891c4572db2529ba3df275685a6ac0c1b4ec2f98 /clang/test/SemaTemplate/instantiate-local-class.cpp
parent5295793bcaf4cd143021ddf6a2d3cab3d801bfcc (diff)
downloadbcm5719-llvm-180b92168dd61c0d6c61eaa241c3c21bd892a19b.tar.gz
bcm5719-llvm-180b92168dd61c0d6c61eaa241c3c21bd892a19b.zip
PR20625: Instantiate static constexpr member function of a local struct in a function template earlier.
This is necessary in order to allow the use of a constexpr member function, or a member function with deduced return type, of a local class within a surrounding instantiated function template specialization. Patch by Michael Park! llvm-svn: 236063
Diffstat (limited to 'clang/test/SemaTemplate/instantiate-local-class.cpp')
-rw-r--r--clang/test/SemaTemplate/instantiate-local-class.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/instantiate-local-class.cpp b/clang/test/SemaTemplate/instantiate-local-class.cpp
index 367134a2a53..668fb6fa65b 100644
--- a/clang/test/SemaTemplate/instantiate-local-class.cpp
+++ b/clang/test/SemaTemplate/instantiate-local-class.cpp
@@ -213,3 +213,16 @@ namespace PR23194 {
return make_seed_pair();
}
}
+
+namespace PR20625 {
+template <typename T>
+void f() {
+ struct N {
+ static constexpr int get() { return 42; }
+ };
+ constexpr int n = N::get();
+ static_assert(n == 42, "n == 42");
+}
+
+void g() { f<void>(); }
+}
OpenPOWER on IntegriCloud