Consider the following:

```
// foo.h
class Foo
{
   public:
      int x = 2;
      int y = 3;
      void DoSomething_SSE();
      void DoSomething_AVX();
   // ( Implicit default constructor is generated "inline" here )
};

// Foo_AVX.cpp, compiled with -mavx or /arch:AVX
void Foo::DoSomething_AVX()
{
   // AVX optimised implementation here
}

// Foo_SSE.cpp, compiled with -msse2 or /arch:SSE2
void Foo::DoSomething_SSE()
{
   // SSE optimised implementation here
}

```

Here's the problem: the compiler will generate the implied default constructor with 'inline' semantics (note: inline semantics does *not* mean the function will necessarily be inlined) in each translation unit, and - in cases where the constructor is not inlined - the linker will then choose one implementation and discard the other.

If the linker chooses the constructor generated in the AVX compilation unit, this code will then crash with an illegal instruction on a machine which doesn't support AVX.

It is possible to stop the crash by putting in an explicit default constructor, either \_\_forceinline (to make sure it's inlined once per compilation unit), or declared in the header and defined in a compilation unit which is compiled with the lowest common denominator instruction set.

However, surely there's a way to get the language to handle this better than having to write dummy functions..?

(llvm-clang++ 9.x.x/x64 on Mac OS X)