Bug 29485 - missing diagnostic when declared inline
Summary: missing diagnostic when declared inline
Status: RESOLVED DUPLICATE of bug 21678
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.1.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: diagnostic
Depends on:
Blocks:
 
Reported: 2006-10-16 16:46 UTC by Dirk Mueller
Modified: 2006-10-16 17:04 UTC (History)
4 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 Dirk Mueller 2006-10-16 16:46:00 UTC
Hi, 

this testcase fails to produce a "return value missing" diagnostic: 

=== Cut ===

class test
{
    bool fii(test* other)
    {
        if (!other) return false;
    }

};

=== Cut ===

Interestingly, it works when declared outside the class itself, which makes me suspect that this is caused by some C++ parser oddity.
Comment 1 Andrew Pinski 2006-10-16 17:01:32 UTC
Actually all inlined functions for C++ are missing the diagnostic:
inline int fii(int *other)
{
  if(!other)return 0;
}
Comment 2 Andrew Pinski 2006-10-16 17:02:35 UTC
(In reply to comment #0)
> Interestingly, it works when declared outside the class itself, which makes me
> suspect that this is caused by some C++ parser oddity.
Are you sure because I could reproduce the missing warning for all inline functions with the C++ front-end.
Comment 3 Andrew Pinski 2006-10-16 17:04:52 UTC

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