summaryrefslogtreecommitdiffstats
path: root/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p8.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p8.cpp')
-rw-r--r--test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p8.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p8.cpp b/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p8.cpp
index f7da24d..c4935b3 100644
--- a/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p8.cpp
+++ b/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p8.cpp
@@ -1,13 +1,17 @@
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
struct S {
- constexpr void f();
- constexpr void g() const;
+ constexpr int f();
+ constexpr int g() const;
+ static constexpr int Sf();
};
void f(const S &s) {
s.f();
s.g();
+
+ int (*f)() = &S::Sf;
+ int (S::*g)() const = &S::g;
}
namespace std_example {
@@ -26,3 +30,9 @@ namespace std_example {
{ return x * 2 + 3 * y; }
}
+
+// The constexpr specifier is allowed for static member functions of non-literal types.
+class NonLiteralClass {
+ NonLiteralClass(bool);
+ static constexpr bool isDebugFlag();
+};
OpenPOWER on IntegriCloud