[cfe-commits] r58353 - in /cfe/trunk: include/clang/AST/Expr.h include/clang/Basic/DiagnosticKinds.def include/clang/Parse/Action.h lib/AST/Expr.cpp lib/Parse/ParseDecl.cpp lib/Sema/Sema.h lib/Sema/SemaChecking.cpp lib/Sema/SemaDecl.cpp lib/Sema/

Doug Gregor doug.gregor at gmail.com
Wed Oct 29 06:52:35 PDT 2008


On Wed, Oct 29, 2008 at 2:25 AM, Daniel Dunbar <daniel at zuster.org> wrote:
>
> On Tue, Oct 28, 2008 at 5:14 PM, Douglas Gregor <doug.gregor at gmail.com>
> 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?

Thanks!

That'll teach me to develop on Linux. Fixed now by temporarily disable
the check (it's actually the check below the one you show above);
we'll bring the check back when we sort out linkage-specifications.

  - Doug



More information about the cfe-commits mailing list