[cfe-commits] [PATCH] Bugfix: bogus error message "invalid use of non-static data member"

Eli Friedman eli.friedman at gmail.com
Thu Feb 23 13:36:13 PST 2012


On Wed, Feb 22, 2012 at 10:21 AM, Delesley Hutchins <delesley at google.com> wrote:
> This fixes a bug where clang erroneously reports "invalid use of
> non-static data member" if a class is forward declared, and the
> reference to data member in question occurs outside of a member
> function (e.g. in an attribute).  See patch for example.
>
> Patch:
>  http://codereview.appspot.com/5684064/

Please also include the following C++11 testcase:

class Foo;
class Foo {
  int x;
  int y = x;
};

Otherwise, looks fine.

-Eli




More information about the cfe-commits mailing list