[odb-users] Compiling the generated code using clang++ on OS X

Boris Kolpackov boris at codesynthesis.com
Thu Jul 11 07:04:43 EDT 2013


Hi Jeff,

Jeff Waller <truthset at gmail.com> writes:

> I have not managed to install odb (the analyzer) on OS X,

Did you try the binary package? Should work fine out of the box.


> Domain.cpp:15:30: warning: lookup of 'query' in member access expression
> is ambiguous; using member of 'odb::database' [-Wambiguous-member-template]
>    odb::result<Domain> r(db->query<Domain>(q));

Yes, this is Clang being anal self. Essentially, when you have this:

using namespace odb::core; // Brings in odb::query class template.

db->query<Domain> ();

Then Clang thinks that db->query is ambiguous somehow. There is probably
something in the standard that implies this behavior even though it
doesn't make any practical sense. But Clang decides to follow the
standard to the letter.

The only workaround (other than disabling the warning) is not to use
the using directive:

using odb::database;
using odb::transaction;
...

db->query<Domain> ();

Boris



More information about the odb-users mailing list