RE: Potentially bogus warning about anonymous types

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> There is if you include test.hpp in multiple translation units (and
> the compiler has to assume you will) because foo() is not declared
> inline. Do that and the warning goes away.

I see. Is there something about a nested class, template specialization,
or a base class that causes that example to be an ODR violation but
not this one (which GCC does not warn about):
 
 
template <typename T>
struct inner
{
    static const bool value = true;
};
 
bool foo()
{
    auto lambda = [](){};
    typedef decltype(lambda) Lambda;
    return inner<Lambda>::value;
}
 
 
Thanks,
Nate 		 	   		  




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux