Exemple #1
0
void
check_declarations(Context& cxt, Type_decl const& d1, Type_decl const& d2)
{
  Type const& t1 = d1.type();
  Type const& t2 = d2.type();
  if (is_different(t1, t2)) {
    // TODO: Get the source location right.
    error(cxt, "declaration of '{}' as a different kind of type", d1.name());
    note("'{}' previously declared as:", d1.name());
    
    // TODO: Don't print the definition. It's not germaine to
    // the error. If we have source locations, I wonder if we
    // can just point at the line.
    note("{}", d1);
    throw Declaration_error();
  }
}
Exemple #2
0
// FIXME: Verify this diagnostics.
void
check_declarations(Context& cxt, Type_decl const& d1, Type_decl const& d2)
{
    error(cxt, "declaration of '{}' as a different kind of type", d1.name());
    throw Declaration_error();
}