void DeclPrinter::VisitVarDecl(VarDecl *D) {
prettyPrintPragmas(D);
+
+ QualType T = D->getTypeSourceInfo()
+ ? D->getTypeSourceInfo()->getType()
+ : D->getASTContext().getUnqualifiedObjCPointerType(D->getType());
+
if (!Policy.SuppressSpecifiers) {
StorageClass SC = D->getStorageClass();
if (SC != SC_None)
if (D->isModulePrivate())
Out << "__module_private__ ";
+
+ if (D->isConstexpr()) {
+ Out << "constexpr ";
+ T.removeLocalConst();
+ }
}
- QualType T = D->getTypeSourceInfo()
- ? D->getTypeSourceInfo()->getType()
- : D->getASTContext().getUnqualifiedObjCPointerType(D->getType());
printDeclType(T, D->getName());
Expr *Init = D->getInit();
if (!Policy.SuppressInitializers && Init) {
};
}
-namespace dont_crash {
+namespace dont_crash_on_auto_vars {
struct T { enum E {X = 12ll }; };
struct S {
struct { int I; } ADecl;
static const auto Y = T::X;
};
//CHECK: static const auto Y = T::X;
+constexpr auto var = T::X;
+//CHECK: constexpr auto var = T::X;
}