Bug 36656 - useless warning: type qualifiers ignored on function return type in template code
Summary: useless warning: type qualifiers ignored on function return type in template ...
Status: RESOLVED DUPLICATE of bug 36052
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.3.1
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-27 17:44 UTC by Martin Sebor
Modified: 2008-06-27 17:46 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Sebor 2008-06-27 17:44:28 UTC
The warning below is unhelpful in generic code and silencing it by removing
the top-level cv qualifiers is unnecessarily tedious.

$ cat t.cpp && g++ t.cpp -W
template <class T>
T foo () { return T (); }

int main ()
{
    foo<const int>();
}
t.cpp: In function 'int main()':
t.cpp:2: warning: type qualifiers ignored on function return type
Comment 1 Andrew Pinski 2008-06-27 17:46:19 UTC

*** This bug has been marked as a duplicate of 36052 ***