Var->getName(),
SourceRange(Var->getLocation(), Var->getLocation()));
+#if 0
+ // FIXME: Temporarily disabled because we are not properly parsing
+ // linkage specifications on declarations, e.g.,
+ //
+ // extern "C" const CGPoint CGPointerZero;
+ //
// C++ [dcl.init]p9:
//
// If no initializer is specified for an object, and the
// FIXME: Actually perform the POD/user-defined default
// constructor check.
if (getLangOptions().CPlusPlus &&
- Context.getCanonicalType(Type).isConstQualified())
+ Context.getCanonicalType(Type).isConstQualified() &&
+ Var->getStorageClass() != VarDecl::Extern)
Diag(Var->getLocation(),
diag::err_const_var_requires_init,
Var->getName(),
SourceRange(Var->getLocation(), Var->getLocation()));
+#endif
}
}
int& test6(int& x) {
int& yo; // expected-error{{declaration of reference variable 'yo' requires an initializer}}
-
- const int val; // expected-error{{declaration of const variable 'val' requires an initializer}}
-
return x;
}
int& not_initialized_error; // expected-error{{declaration of reference variable 'not_initialized_error' requires an initializer}}