[cfe-dev] clang and -pedantic

Douglas Gregor dgregor at apple.com
Wed Jan 19 08:45:28 PST 2011

On Jan 18, 2011, at 9:36 AM, Marshall Clow wrote:

> I got some warnings while compiling part of boost with clang TOT.
> In particular, it warned about "extra ; in class definitions"
>> In file included from ../../../libs/test/src/unit_test_monitor.cpp:16:
>> In file included from ../../../boost/test/impl/unit_test_monitor.ipp:22:
>> In file included from ../../../boost/test/test_tools.hpp:19:
>> ../../../boost/test/predicate_result.hpp:44:37: warning: extra ';' inside a struct [-pedantic]
>>    struct dummy { void nonnull() {}; };
> So (after some prodding), I looked in the standard and found section 9.2 (class members), where it
> appears to show that the semicolon after the member function definition is optional.
> Then I went to http://clang.llvm.org/docs/UsersManual.html , where it says that 
>> 	-pedantic: Warn on language extensions.
> It seems to me that the extra semicolon is not a language extension.
> What is the rationale behind having it warn, then?

It was a bug, that's fixed in r123835.

	- Doug

More information about the cfe-dev mailing list