summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-02-13 22:16:19 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-02-13 22:16:19 +0000
commit6331c408b5eb4ea3c645b5df04a33f70748894c4 (patch)
treefc436a0549e73b16d39200f4e46c9158ad830d35 /clang/test/CXX
parent4809fc1d9df7c7de4fece44619df32f21836f341 (diff)
downloadbcm5719-llvm-6331c408b5eb4ea3c645b5df04a33f70748894c4.tar.gz
bcm5719-llvm-6331c408b5eb4ea3c645b5df04a33f70748894c4.zip
Deal with a horrible C++11 special case. If a non-literal type has a constexpr
constructor, and that constructor is used to initialize an object of static storage duration such that all members and bases are initialized by constant expressions, constant initialization is performed. In this case, the object can still have a non-trivial destructor, and if it does, we must emit a dynamic initializer which performs no initialization and instead simply registers that destructor. llvm-svn: 150419
Diffstat (limited to 'clang/test/CXX')
-rw-r--r--clang/test/CXX/class/class.static/class.static.data/p3.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/test/CXX/class/class.static/class.static.data/p3.cpp b/clang/test/CXX/class/class.static/class.static.data/p3.cpp
index fef9a7dae16..117997ee283 100644
--- a/clang/test/CXX/class/class.static/class.static.data/p3.cpp
+++ b/clang/test/CXX/class/class.static/class.static.data/p3.cpp
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
-struct NonLit { // expected-note {{no constexpr constructors}}
+struct NonLit { // expected-note 3{{no constexpr constructors}}
NonLit();
};
@@ -30,11 +30,11 @@ struct U {
static constexpr int a = 0;
static constexpr int b; // expected-error {{declaration of constexpr static data member 'b' requires an initializer}}
static constexpr NonLit h = NonLit(); // expected-error {{cannot have non-literal type 'const NonLit'}}
- static constexpr T c = T(); // expected-error {{must be initialized by a constant expression}} expected-note {{non-literal type}}
+ static constexpr T c = T(); // expected-error {{cannot have non-literal type}}
static const T d;
};
-template<typename T> constexpr T U<T>::d = T(); // expected-error {{must be initialized by a constant expression}} expected-note {{non-literal type 'const NonLit'}}
+template<typename T> constexpr T U<T>::d = T(); // expected-error {{non-literal type 'const NonLit'}}
U<int> u1;
U<NonLit> u2; // expected-note {{here}}
OpenPOWER on IntegriCloud