[llvm-bugs] [Bug 45751] New: Broken inspection when using a template

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Apr 30 01:22:19 PDT 2020


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: unassignedclangbugs at nondot.org
          Reporter: chladektomas at gmail.com
                CC: blitzrakete at gmail.com, erik.pilkington at gmail.com,
                    llvm-bugs at lists.llvm.org, richard-llvm at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200430/0f22fa20/attachment-0001.html>


More information about the llvm-bugs mailing list