This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/69733] New: -Wignored-qualifiers points to wrong const
- From: "trippels at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 09 Feb 2016 11:07:43 +0000
- Subject: [Bug c++/69733] New: -Wignored-qualifiers points to wrong const
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69733
Bug ID: 69733
Summary: -Wignored-qualifiers points to wrong const
Product: gcc
Version: 6.0
Status: UNCONFIRMED
Keywords: diagnostic
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: trippels at gcc dot gnu.org
Target Milestone: ---
markus@x4 tmp % cat const.ii
class A {
private:
double val;
public:
const double value() const {return val;}
};
markus@x4 tmp % clang++ -c -Wall -Wextra const.ii
const.ii:5:4: warning: 'const' type qualifier on return type has no effect
[-Wignored-qualifiers]
const double value() const {return val;}
^~~~~~
1 warning generated.
markus@x4 tmp % icpc -c -Wall -Wextra const.ii
const.ii(5): warning #858: type qualifier on return type is meaningless
const double value() const {return val;}
^
markus@x4 tmp % g++ -c -Wall -Wextra const.ii
const.ii:5:25: warning: type qualifiers ignored on function return type
[-Wignored-qualifiers]
const double value() const {return val;}
^~~~~