From d9edd11e9880b153fe22bd6c75436cc228a1a0a5 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Fri, 17 Aug 2018 11:13:46 -0400 Subject: [PATCH 05/18] FIXME: WIP on missing-parens-fixit.C ../../src/gcc/testsuite/g++.dg/parse/missing-parens-fixit.C: In function 'bool test_1(const t1&)': ../../src/gcc/testsuite/g++.dg/parse/missing-parens-fixit.C:14:15: error: invalid use of member function 'double t1::length() const' (did you forget the '()' ?) 14 | return inst.length > 0.0; | ~~~~~^~~~~~ 514 if (DECL_FUNCTION_MEMBER_P (member) 515 && ! flag_ms_extensions) 516 emit_diagnostic (diag_kind, loc, 0, 517 "invalid use of member function %qD " 518 "(did you forget the %<()%> ?)", member); 519 else 520 emit_diagnostic (diag_kind, loc, 0, 521 "invalid use of member %qD " 522 "(did you forget the %<&%> ?)", member); --- gcc/testsuite/g++.dg/parse/missing-parens-fixit.C | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 gcc/testsuite/g++.dg/parse/missing-parens-fixit.C diff --git a/gcc/testsuite/g++.dg/parse/missing-parens-fixit.C b/gcc/testsuite/g++.dg/parse/missing-parens-fixit.C new file mode 100644 index 0000000..eb60bfd --- /dev/null +++ b/gcc/testsuite/g++.dg/parse/missing-parens-fixit.C @@ -0,0 +1,15 @@ +// { dg-options "-fdiagnostics-show-caret" } + +class t1 +{ +public: + double length () const { return m_length; } + +private: + double m_length; +}; + +bool test_1 (const t1 &inst) +{ + return inst.length > 0.0; +} -- 1.8.5.3