<div><br><div class="gmail_quote">On Tue, Oct 28, 2008 at 5:14 PM, Douglas Gregor <span dir="ltr"><<a href="mailto:doug.gregor@gmail.com">doug.gregor@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
+void Sema::ActOnUninitializedDecl(DeclTy *dcl) {<br>
+  Decl *RealDecl = static_cast<Decl *>(dcl);<br>
+<br>
+  if (VarDecl *Var = dyn_cast<VarDecl>(RealDecl)) {<br>
+    QualType Type = Var->getType();<br>
+    // C++ [dcl.init.ref]p3:<br>
+    //   The initializer can be omitted for a reference only in a<br>
+    //   parameter declaration (8.3.5), in the declaration of a<br>
+    //   function return type, in the declaration of a class member<br>
+    //   within its class declaration (9.2), and where the extern<br>
+    //   specifier is explicitly used.<br>
+    if (Type->isReferenceType() && Var->getStorageClass() != VarDecl::Extern)<br>
+      Diag(Var->getLocation(),<br>
+           diag::err_reference_var_requires_init,<br>
+           Var->getName(),<br>
+           SourceRange(Var->getLocation(), Var->getLocation()));<br></blockquote><div><br></div>This is causing test/SemaCXX/carbon.cpp to fail on OS X (rather verbosely... we should probably implement a max error count).<div>
<br></div><div>I suspect this issue has to do with extern "C" not being handled... can you investigate?</div><div><br></div><div> - Daniel</div><div><br></div></div></div>