summaryrefslogtreecommitdiff
path: root/clang/test/AST/Interp/cxx11.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/AST/Interp/cxx11.cpp')
-rw-r--r--clang/test/AST/Interp/cxx11.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/test/AST/Interp/cxx11.cpp b/clang/test/AST/Interp/cxx11.cpp
index f06a5dd173cb..82b2727bbadb 100644
--- a/clang/test/AST/Interp/cxx11.cpp
+++ b/clang/test/AST/Interp/cxx11.cpp
@@ -46,3 +46,19 @@ constexpr int preInc(int x) { // both-error {{never produces a constant expressi
constexpr int postInc(int x) { // both-error {{never produces a constant expression}}
return x++; // both-note {{subexpression}}
}
+
+
+namespace ReferenceToConst {
+ template<int n> struct S; // both-note 1{{here}}
+ struct LiteralType {
+ constexpr LiteralType(int n) : n(n) {}
+ int n;
+ };
+ template<int n> struct T {
+ T() {
+ static const int ki = 42;
+ const int &i2 = ki;
+ typename S<i2>::T check5; // both-error {{undefined template}}
+ }
+ };
+}