summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorTom Stellard <tstellar@redhat.com>2018-04-07 03:30:07 +0000
committerTom Stellard <tstellar@redhat.com>2018-04-07 03:30:07 +0000
commitd5f48a217f404c3462537527f4169bb45eed3904 (patch)
tree6987563cb1aae0c02ba865a5646d268320784aff /test
parentff0c0d8ab3e316bb6e2741fedb3b545e198eab7a (diff)
Merging r327099:
------------------------------------------------------------------------ r327099 | rsmith | 2018-03-08 18:00:01 -0800 (Thu, 08 Mar 2018) | 3 lines PR36645: Go looking for an appropriate array bound when constant-evaluating a name of an array object. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_60@329478 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/SemaCXX/constant-expression-cxx11.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/SemaCXX/constant-expression-cxx11.cpp b/test/SemaCXX/constant-expression-cxx11.cpp
index 51dd6199e6..fe4c54e7e6 100644
--- a/test/SemaCXX/constant-expression-cxx11.cpp
+++ b/test/SemaCXX/constant-expression-cxx11.cpp
@@ -629,6 +629,10 @@ namespace ArrayOfUnknownBound {
extern const int carr[]; // expected-note {{here}}
constexpr int n = carr[0]; // expected-error {{constant}} expected-note {{non-constexpr variable}}
+
+ constexpr int local_extern[] = {1, 2, 3};
+ void f() { extern const int local_extern[]; }
+ static_assert(local_extern[1] == 2, "");
}
namespace DependentValues {