summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/constant-expression-cxx1y.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-11-06 02:19:10 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-11-06 02:19:10 +0000
commit4e66f1faa1a0aead750248c00947d70a9901af92 (patch)
treec278166e4586b627ff9e2265ccfc450acd8b39a1 /clang/test/SemaCXX/constant-expression-cxx1y.cpp
parent34e2f0c4ea326298f4dd39c31d9f085d076e9051 (diff)
downloadbcm5719-llvm-4e66f1faa1a0aead750248c00947d70a9901af92.tar.gz
bcm5719-llvm-4e66f1faa1a0aead750248c00947d70a9901af92.zip
More constant evaluation cleanup, and fix an issue where we'd override an
earlier 'non-constant' diagnostic with a later one if the earlier one was from a side-effect we thought we could evaluate past. llvm-svn: 194117
Diffstat (limited to 'clang/test/SemaCXX/constant-expression-cxx1y.cpp')
-rw-r--r--clang/test/SemaCXX/constant-expression-cxx1y.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/test/SemaCXX/constant-expression-cxx1y.cpp b/clang/test/SemaCXX/constant-expression-cxx1y.cpp
index ebe8e989a83..7a2fa44c217 100644
--- a/clang/test/SemaCXX/constant-expression-cxx1y.cpp
+++ b/clang/test/SemaCXX/constant-expression-cxx1y.cpp
@@ -128,10 +128,10 @@ constexpr int namespace_alias() {
namespace assign {
constexpr int a = 0;
const int b = 0;
- int c = 0; // expected-note 2{{here}}
+ int c = 0; // expected-note {{here}}
constexpr void set(const int &a, int b) {
- const_cast<int&>(a) = b; // expected-note 2{{constant expression cannot modify an object that is visible outside that expression}}
+ const_cast<int&>(a) = b; // expected-note 3{{constant expression cannot modify an object that is visible outside that expression}}
}
constexpr int wrap(int a, int b) {
set(a, b);
@@ -140,7 +140,7 @@ namespace assign {
static_assert((set(a, 1), a) == 1, ""); // expected-error {{constant expression}} expected-note {{in call to 'set(a, 1)'}}
static_assert((set(b, 1), b) == 1, ""); // expected-error {{constant expression}} expected-note {{in call to 'set(b, 1)'}}
- static_assert((set(c, 1), c) == 1, ""); // expected-error {{constant expression}} expected-note {{read of non-const variable 'c'}}
+ static_assert((set(c, 1), c) == 1, ""); // expected-error {{constant expression}} expected-note {{in call to 'set(c, 1)'}}
static_assert(wrap(a, 1) == 1, "");
static_assert(wrap(b, 1) == 1, "");
OpenPOWER on IntegriCloud