On Tue, Oct 28, 2008 at 5:14 PM, Douglas Gregor <[EMAIL PROTECTED]>wrote:

>
> +void Sema::ActOnUninitializedDecl(DeclTy *dcl) {
> +  Decl *RealDecl = static_cast<Decl *>(dcl);
> +
> +  if (VarDecl *Var = dyn_cast<VarDecl>(RealDecl)) {
> +    QualType Type = Var->getType();
> +    // C++ [dcl.init.ref]p3:
> +    //   The initializer can be omitted for a reference only in a
> +    //   parameter declaration (8.3.5), in the declaration of a
> +    //   function return type, in the declaration of a class member
> +    //   within its class declaration (9.2), and where the extern
> +    //   specifier is explicitly used.
> +    if (Type->isReferenceType() && Var->getStorageClass() !=
> VarDecl::Extern)
> +      Diag(Var->getLocation(),
> +           diag::err_reference_var_requires_init,
> +           Var->getName(),
> +           SourceRange(Var->getLocation(), Var->getLocation()));
>

This is causing test/SemaCXX/carbon.cpp to fail on OS X (rather verbosely...
we should probably implement a max error count).
I suspect this issue has to do with extern "C" not being handled... can you
investigate?

 - Daniel
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to