Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

llvm 3.71 does not allow for macro resolution after constructor or destructor #26512

Closed Quuxplusone closed 8 years ago

Quuxplusone commented 8 years ago
Bugzilla Link PR26513
Status RESOLVED INVALID
Importance P normal
Reported by mattreecebentley@gmail.com (mattreecebentley@gmail.com)
Reported on 2016-02-07 03:03:48 -0800
Last modified on 2016-02-08 17:42:42 -0800
Version 3.7
Hardware PC Windows NT
CC dgregor@apple.com, llvm-bugs@lists.llvm.org, rnk@google.com
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also
As noted.
Under win7 x64.
Quuxplusone commented 8 years ago
ie. When this happens:

#if defined(__cplusplus) && __cplusplus >= 201103L
    #define PLF_NOEXCEPT noexcept
#else
    #define PLF_NOEXCEPT throw()
#endif

and this happens:

group() PLF_NOEXCEPT;

~group() PLF_NOEXCEPT;

Clang says this:
error: expected ';' at end of declaration list
                        group() PLF_NOEXCEPT
Quuxplusone commented 8 years ago

Realised this was because of a stupid #undef

Quuxplusone commented 8 years ago

Aside from some ifdef/undef confusion, this is because C++11 is enabled by default on Windows when targeting MSVC. You can override it with -std=c++98 to get the old behavior if you really want.

Quuxplusone commented 8 years ago
Currently compiling under codelite, TDM mingw64.
Not sure why it would be targeting MSVC, unless it doesn't this by default
under Windows.