summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclCXX.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2011-11-07 22:16:17 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2011-11-07 22:16:17 +0000
commiteda3c8469827faff11f3ab423492c3bc7e27ea0c (patch)
treefe2f349d4a7792187167225122075ea6e037cd5c /clang/lib/Sema/SemaDeclCXX.cpp
parent5139dadd503c928d0dfc3515e0fc92dc4cdf25b4 (diff)
downloadbcm5719-llvm-eda3c8469827faff11f3ab423492c3bc7e27ea0c.tar.gz
bcm5719-llvm-eda3c8469827faff11f3ab423492c3bc7e27ea0c.zip
constexpr: static data members declared constexpr are required to have an
initializer; all other constexpr variables are merely required to be initialized. In particular, a user-provided constexpr default constructor can be used for such initialization. llvm-svn: 144028
Diffstat (limited to 'clang/lib/Sema/SemaDeclCXX.cpp')
-rw-r--r--clang/lib/Sema/SemaDeclCXX.cpp10
1 files changed, 0 insertions, 10 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index a4e25231a73..db2dd22e68c 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -8972,16 +8972,6 @@ void Sema::AddCXXDirectInitializerToDecl(Decl *RealDecl,
Expr *Init = Result.get();
CheckImplicitConversions(Init, LParenLoc);
-
- if (VDecl->isConstexpr() && !VDecl->isInvalidDecl() &&
- !Init->isValueDependent() &&
- !Init->isConstantInitializer(Context,
- VDecl->getType()->isReferenceType())) {
- // FIXME: Improve this diagnostic to explain why the initializer is not
- // a constant expression.
- Diag(VDecl->getLocation(), diag::err_constexpr_var_requires_const_init)
- << VDecl << Init->getSourceRange();
- }
Init = MaybeCreateExprWithCleanups(Init);
VDecl->setInit(Init);
OpenPOWER on IntegriCloud