I am struggling with what appears to be an ambiguity in c++11 symbol resolution due to the GNU standard library implementation in this environment:
- Arch Linux 4.2.5-1 (x86_64)
- g++ 5.2.0
- clang++ 3.7.0
Example:
#include <iostream>
#include <string>
struct version {
  unsigned major;
  unsigned minor;
  unsigned patch;
  version(unsigned major, unsigned minor, unsigned patch) :
    major(major), minor(minor), patch(patch) { }
  friend std::ostream & operator<<(std::ostream & out, version const& v) {
    out << v.major << ".";
    out << v.minor << ".";
    out << v.patch;
    return out;
  }
};
int main(int argc, char ** argv) {
  version v(1, 1, 0);
  std::cout << v << std::endl;
  return 0;
}
Compiler error:
error: member initializer 'gnu_dev_major' does not name a non-static data
  member or base class
error: member initializer 'gnu_dev_minor' does not name a non-static data
  member or base class
Command:
clang++ -std=c++11 -o test *.cpp
The scope resolution operator does not appear to be applicable in member initialization lists so I can't figure out how to resolve the ambiguity. This sample compiles fine without the c++11 flag.
 
     
     
     
     
     
    