https://bugs.llvm.org/show_bug.cgi?id=45751

            Bug ID: 45751
           Summary: Broken inspection when using a template
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++17
          Assignee: unassignedclangb...@nondot.org
          Reporter: chladekto...@gmail.com
                CC: blitzrak...@gmail.com, erik.pilking...@gmail.com,
                    llvm-bugs@lists.llvm.org, richard-l...@metafoo.co.uk

Created attachment 23427
  --> https://bugs.llvm.org/attachment.cgi?id=23427&action=edit
screenshot

Looks like template breaks inspection. Android Studio doesn't show "Control
reaches end of non-void function" and "Member function can be static" warnings
(maybe more) when using a template.

Is possible to set severity to Error for message "Control reaches end of
non-void function"? Application crashes when non-void function does not return
something.

Test code:
#pragma once

float getFloatValue() {
}

float &getFloatReference() {
}

float *getFloatPointer() {
}

template<typename T>
T doSomething(float a) {
}

template<typename T>
float doSomething(T a, T b) {
}

template<typename T>
struct ClassA {
        ClassA &doSomething();
};

template<typename T>
ClassA<T> &ClassA<T>::doSomething() {
}

struct ClassB {
        float doNothing();
};

float ClassB::doNothing() {
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to