if (Attr->getMaxArgs() && !NumArgs) {
// The attribute was allowed to have arguments, but none were provided
// even though the attribute parsed successfully. This is an error.
- // FIXME: This is a good place for a fixit which removes the parens.
Diag(LParenLoc, diag::err_attribute_requires_arguments) << AttrName;
return false;
} else if (!Attr->getMaxArgs()) {
// arguments. It doesn't matter whether any were provided -- the
// presence of the argument list (even if empty) is diagnosed.
Diag(LParenLoc, diag::err_cxx11_attribute_forbids_arguments)
- << AttrName;
+ << AttrName
+ << FixItHint::CreateRemoval(SourceRange(LParenLoc, *EndLoc));
return false;
}
}
--- /dev/null
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s\r
+// RUN: not %clang_cc1 -fsyntax-only -fdiagnostics-parseable-fixits -std=c++11 %s 2>&1 | FileCheck %s\r
+\r
+[[noreturn()]] void f(); // expected-error {{attribute 'noreturn' cannot have an argument list}} \\r
+// CHECK: fix-it:"{{.*}}":{4:11-4:13}:""\r