Potential error in code highlighting

已回答

Hi,

First this is my first post here and Im pretty new to all of this so I apologize in advance if I am in the wrong place, I tried going to the known issues but was unable to post this there.

Anyhow I have noticed in the following code where CoffeeMachine::CoffeeMachine(string name) is riddled with errors in the CLion IDE. I could be doing something wrong but I think not because the second function CoffeeMachine::CoffeeMachine(int water_capacity, int coffee_capacity, string name) doesn't report any errors in the IDE. Having arguments before the string argument or using std::string resolve this but it seems unnecessary as I dont need to use std::string in the second function and I have the call for using namespace std;, anyway hope this helps and someone can resolve this.

#include <iostream>
#include <iomanip>

using namespace std;

class CoffeeMachine {
public:
string name;
void makeCups(int n);
void addWater(int n);
void addCoffee(int n);
void displayCM();

CoffeeMachine();
CoffeeMachine(string);
CoffeeMachine(int, int, string);
~CoffeeMachine();

private:
void makeSingleCup ();
void setValues(int, int, int, int, string);
int water_capacity;
int coffee_capacity;
int curr_water;
int curr_coffee;
};

CoffeeMachine::CoffeeMachine(string name) {
cout << "Starting up Coffee Machine " << name
<< " with empty resources." << endl;
}

CoffeeMachine::CoffeeMachine(int water_capacity, int coffee_capacity, string name) {
cout << "Starting up Coffee Machine " << name
<< " with empty resources and defined capacities." << endl;
}
0
Avatar
Permanently deleted user

Oh I forgot to mention with g++ the whole program compiles and executes find with no errors or warnings.

0

Hi! Sorry for the inconvenience! The fix will be available in next CLion 2017.1 EAP. Please follow to get the updates.

0

请先登录再写评论。