-
-
Notifications
You must be signed in to change notification settings - Fork 7k
template <typename Generic> can not compile with the lastedt version 1.6.8. #4751
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @EagleSmith , |
just a blind guess, but could be that the function prototype spans over two lines? template <typename Generic> void DEBUG_WM(Generic text) {
if (_debug) {
Serial.print("*WM: ");
Serial.println(text);
}
} ? |
I was about to report something similar when I found this report. If you remove the line break it compiles OK. With the break, the preprocessed code is: template <typename Generic>
#line 4 "/tmp/arduino_modified_sketch_455371/sketch_jun04c.ino"
void DEBUG_WM(Generic text) ;
#line 11 "/tmp/arduino_modified_sketch_455371/sketch_jun04c.ino"
void setup();
#line 16 "/tmp/arduino_modified_sketch_455371/sketch_jun04c.ino"
void loop();
#line 4
void DEBUG_WM(Generic text) {
if (_debug) {
Serial.print("*WM: ");
Serial.println(text);
}
} Arduino .ino file was: bool _debug = true;
template <typename Generic>
void DEBUG_WM(Generic text) {
if (_debug) {
Serial.print("*WM: ");
Serial.println(text);
}
}
void setup() { }
void loop() { } Removing the #line directives the problem is it was expanded out to: template <typename Generic>
void DEBUG_WM(Generic text) ;
void setup();
void loop();
void DEBUG_WM(Generic text) { The template line is not repeated. The prototype is OK, but the "real" function (definition) does not get the template line. The regexp or whatever-you-use to find a function declaration needs to allow for a line break in the declaration. IDE 1.6.8 and 1.6.9. |
I confirm this is still present in 1.8.1. Uno R3 target. |
Should be solved by arduino/arduino-builder#182, @VioletGiraffe could you test it? Thx |
@facchinm : how can I test it? Sorry, I'm new around here :) |
No problem 🙂 You don't need to install go, simply download the build produced by @ArduinoBot (http://downloads.arduino.cc/PR/arduino-builder/arduino-builder-182.zip) and replace the |
Good to know! Yes, that indeed does solve the problem. Thanks. |
I also confirm the issue is solved by arduino/arduino-builder#182 so I'm going to close this. @EagleSmith if you test the arduino/arduino-builder#182 build and find that the problem still occurs please post a minimal complete sketch that demonstrates the problem in addition to the information requested at #4751 (comment) and I'll reopen. |
it's working fine with Previous version(1.6.7)
The text was updated successfully, but these errors were encountered: