[cfe-dev] GCC 6 Warnings

Eric Fiselier via cfe-dev cfe-dev at lists.llvm.org
Wed Sep 7 15:27:56 PDT 2016


Maybe GCC sees a declaration of `clang::Stmt` without the attribute before
it sees the definition? I know GCC is a lot more picky about the order in
which it sees attributes.

On Wed, Sep 7, 2016 at 4:23 PM, Richard Smith via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> On Wed, Sep 7, 2016 at 3:17 PM, Renato Golin via cfe-dev <
> cfe-dev at lists.llvm.org> wrote:
>
>> Clang folks,
>>
>> FYI, I'm getting a lot of warnings from GCC 6.1.1 when building Clang...
>>
>> Haven't had time to look closer and probably won't this week, so if
>> anyone would like to have a go... :)
>>
>>
>> include/llvm/Support/Casting.h:183:72: warning: ignoring attributes on
>> template argument 'llvm::simplify_type<const clang::Stmt*
>> const>::SimpleType {aka const clang::Stmt*}' [-Wignored-attributes]
>>
>
> GCC seems confused. There are no attributes here. Perhaps it's confused
> because clang::Stmt itself has an alignment attribute on its definition?
>
> include/llvm/Support/Casting.h: In instantiation of 'struct
>> llvm::cast_retty<clang::ImplicitCastExpr, const clang::Stmt* const>':
>>
>> include/llvm/Support/Casting.h:222:1:   required by substitution of
>> 'template<class X, class Y> typename std::enable_if<(!
>> llvm::is_simple_type<Y>::value), typename llvm::cast_retty<X, const
>> Y>::ret_type>::type llvm::cast(const Y&) [with X =
>> clang::ImplicitCastExpr; Y = const clang::Stmt*]'
>>
>> tools/clang/include/clang/AST/ASTTypeTraits.h:383:22:   required from
>> 'static const T&
>> clang::ast_type_traits::DynTypedNode::DynCastPtrConverter<T,
>> BaseT>::getUnchecked(clang::ast_type_traits::ASTNodeKind, const char*)
>> [with T = clang::ImplicitCastExpr; BaseT = clang::Stmt]'
>>
>> tools/clang/include/clang/AST/ASTTypeTraits.h:242:42:   required from
>> 'const T& clang::ast_type_traits::DynTypedNode::getUnchecked() const
>> [with T = clang::ImplicitCastExpr]'
>>
>> tools/clang/include/clang/ASTMatchers/ASTMatchersInternal.h:283:19:
>> required from 'bool
>> clang::ast_matchers::internal::MatcherInterface<T>::dynMatches(const
>> clang::ast_type_traits::DynTypedNode&,
>> clang::ast_matchers::internal::ASTMatchFinder*,
>> clang::ast_matchers::internal::BoundNodesTreeBuilder*) const [with T =
>> clang::ImplicitCastExpr]'
>>
>> tools/clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp:1957:1:
>>   required from here
>>
>> include/llvm/Support/Casting.h:134:74: warning: ignoring attributes on
>> template argument 'llvm::simplify_type<const clang::Stmt*
>> const>::SimpleType {aka const clang::Stmt*}' [-Wignored-attributes]
>>    return isa_impl_wrap<X, const Y,
>>           ~~~~~~~~~~~~~~~~~~~~~~~~~
>>                         typename simplify_type<const
>> Y>::SimpleType>::doit(Val);
>>                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> ~~~~~~~~~~~~~~~~~~~~^~~~~
>>
>> etc.
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160907/4492eb85/attachment.html>


More information about the cfe-dev mailing list