How do you set options for the C++ analyzer

AppCode doesn't understand the following code:

     using Map_t = std::map<std::string, int>;

     Map_t myMap;

     myMap["foo"] = 4;

I get error highlights on the using statement and on the assignment statement, saying "foo" is not an integer. However, the code builds with no problem. So I think it is just using the wrong options on clang when parsing the code - probably not the c++11 option. If I change the using to a typedef then the IDE errors go away.


Looks like an issue. But if I include <string> directly I have no red code.
May be it's better for you to try your particular code on the upcoming EAP. Can be fixed there. If no - write us back or place an issue. EAP will be ready very soon.


I only started trying it last night. Mainly looking forward to the cross-platform C++ IDE as a lot of our stuff won't build on the Mac, but I do some of my work there anyway and really want a uniform experience (I use Idea for Java and Idea or PyCharm for python). So this isn't urgent for me but I'd be happy to try the EAP (and even happier to try an EAP of the cross-platform IDE.)


What build system are you using for your C++ projects?


We use a custom system written in python but I think originally based on tmake. It takes a short description of the project (a ".pro" file) and will produce makefiles or VS project files. I'm not sure that this is used for the production builds but it is what the developers use. I've set up Eclipse CDT on Linux and tried to use it but I've always found it wanting.

BTW, here is the original code from my example (I'm back on my mac):

#include <iostream>
#include <map>

int main(int argc, const char * argv[])

    // insert code here...
    std::cout << "Hello, World!\n";

    using Map_t = std::map<std::string, std::pair<int, long>>;

    Map_t myMap;

    myMap["foo"] = std::make_pair(3, 5L);

    std::cout << "map contents: " << myMap["foo"].first << ", " << myMap["foo"].second << std::endl;

    return 0;

If I #include <string> I still get red, but it also tells me that it is an unused include, because it doesn't understand the using line.



I see. Looks like it was a problem with 'using' or somewhere around in 2.5.5. An example with just typedef works fine there. So anyway it should be fixed as I see in 3.0 EAP (just checked your particular example works fine). So please just download it when it's available and try.

Another thing here is that we are working on the cross-platform C++ IDE. But for the first release it supports only CMake build system and uses CMakelists.txt files as project files. Another build systems support will be considered later after 1.0 release.


I'm willing to rebuild the project, at least for testing out IDEs. :)


Yep - looks like the same issue. Thanks.


anastasia.kazakova wrote:
EAP will be ready very soon.

Very soon indeed.
It just popped up on the AppCode EAP page.


Please sign in to leave a comment.