[PATCH] D16751: Enable constexpr on Visual Studio 2015, add support for two equivalent attributes

Alexander Riccio via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 3 10:04:04 PST 2016


ariccio marked 5 inline comments as done.

================
Comment at: C:/LLVM/llvm/include/llvm/Support/Compiler.h:128
@@ -127,1 +127,3 @@
+#elif defined(_MSC_VER)
+#define LLVM_ATTRIBUTE_UNUSED_RESULT _Check_return_
 #else
----------------
aaron.ballman wrote:
> ariccio wrote:
> > rnk wrote:
> > > This is provided by sal.h, right? You should probably add an include like this at the top:
> > >   #ifdef _MSC_VER
> > >   #include <sal.h>
> > >   #endif
> > It is provided by `sal.h`, but it's like `size_t`: you generally don't need to `#include <stddef.h>` to use `size_t`, or `#include <cstddef>`, for `std::size_t` - they're usually included by default or built in.
> > 
> > If you want to be super strict about standards conformance - which is a totally noble goal - then lemme know and I will go ahead and actually `#include <sal.h>`.
> Since Compiler.h is a stand-alone header file, I think it should include sal.h. Good catch, @rnk!
Ok, will do.

================
Comment at: C:/LLVM/llvm/include/llvm/Support/Compiler.h:128
@@ -127,1 +127,3 @@
+#elif defined(_MSC_VER)
+#define LLVM_ATTRIBUTE_UNUSED_RESULT _Check_return_
 #else
----------------
ariccio wrote:
> aaron.ballman wrote:
> > ariccio wrote:
> > > rnk wrote:
> > > > This is provided by sal.h, right? You should probably add an include like this at the top:
> > > >   #ifdef _MSC_VER
> > > >   #include <sal.h>
> > > >   #endif
> > > It is provided by `sal.h`, but it's like `size_t`: you generally don't need to `#include <stddef.h>` to use `size_t`, or `#include <cstddef>`, for `std::size_t` - they're usually included by default or built in.
> > > 
> > > If you want to be super strict about standards conformance - which is a totally noble goal - then lemme know and I will go ahead and actually `#include <sal.h>`.
> > Since Compiler.h is a stand-alone header file, I think it should include sal.h. Good catch, @rnk!
> Ok, will do.
Will upload patch as:

```
#if defined(_MSC_VER)
#include <sal.h>
#endif
```


http://reviews.llvm.org/D16751





More information about the llvm-commits mailing list